attr-print.c 966 B

12345678910111213141516171819202122232425262728293031323334
  1. // RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s
  2. // CHECK: int x __attribute__((aligned(4)));
  3. int x __attribute__((aligned(4)));
  4. // FIXME: Print this at a valid location for a __declspec attr.
  5. // CHECK: int y __declspec(align(4));
  6. __declspec(align(4)) int y;
  7. // CHECK: void foo() __attribute__((const));
  8. void foo() __attribute__((const));
  9. // CHECK: void bar() __attribute__((__const));
  10. void bar() __attribute__((__const));
  11. // CHECK: int * __ptr32 p32;
  12. int * __ptr32 p32;
  13. // CHECK: int * __ptr64 p64;
  14. int * __ptr64 p64;
  15. // TODO: the Type Printer has no way to specify the order to print attributes
  16. // in, and so it currently always prints them in reverse order. Fix this.
  17. // CHECK: int * __ptr32 __uptr p32_2;
  18. int * __uptr __ptr32 p32_2;
  19. // CHECK: int * __ptr64 __sptr p64_2;
  20. int * __sptr __ptr64 p64_2;
  21. // CHECK: int * __ptr32 __uptr p32_3;
  22. int * __uptr __ptr32 p32_3;
  23. // CHECK: int * __sptr * __ptr32 ppsp32;
  24. int * __sptr * __ptr32 ppsp32;