Richard Smith | 0cdcc98 | 2013-01-29 01:24:26 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s |
Michael Han | 9931593 | 2013-01-24 16:46:58 +0000 | [diff] [blame] | 2 | |
Michael Han | af02bbe | 2013-02-01 01:19:17 +0000 | [diff] [blame] | 3 | // CHECK: int x __attribute__((aligned(4))); |
Michael Han | 9931593 | 2013-01-24 16:46:58 +0000 | [diff] [blame] | 4 | int x __attribute__((aligned(4))); |
| 5 | |
Richard Smith | 0cdcc98 | 2013-01-29 01:24:26 +0000 | [diff] [blame] | 6 | // FIXME: Print this at a valid location for a __declspec attr. |
Michael Han | af02bbe | 2013-02-01 01:19:17 +0000 | [diff] [blame] | 7 | // CHECK: int y __declspec(align(4)); |
Richard Smith | 0cdcc98 | 2013-01-29 01:24:26 +0000 | [diff] [blame] | 8 | __declspec(align(4)) int y; |
Michael Han | 9931593 | 2013-01-24 16:46:58 +0000 | [diff] [blame] | 9 | |
| 10 | // CHECK: void foo() __attribute__((const)); |
| 11 | void foo() __attribute__((const)); |
| 12 | |
| 13 | // CHECK: void bar() __attribute__((__const)); |
| 14 | void bar() __attribute__((__const)); |
Richard Smith | 210b67d | 2013-01-29 02:31:57 +0000 | [diff] [blame] | 15 | |
Aaron Ballman | 317a77f | 2013-05-22 23:25:32 +0000 | [diff] [blame^] | 16 | // CHECK: int * __ptr32 p32; |
Richard Smith | 210b67d | 2013-01-29 02:31:57 +0000 | [diff] [blame] | 17 | int * __ptr32 p32; |
| 18 | |
Aaron Ballman | 317a77f | 2013-05-22 23:25:32 +0000 | [diff] [blame^] | 19 | // CHECK: int * __ptr64 p64; |
Richard Smith | 210b67d | 2013-01-29 02:31:57 +0000 | [diff] [blame] | 20 | int * __ptr64 p64; |
Aaron Ballman | 317a77f | 2013-05-22 23:25:32 +0000 | [diff] [blame^] | 21 | |
| 22 | // TODO: the Type Printer has no way to specify the order to print attributes |
| 23 | // in, and so it currently always prints them in reverse order. Fix this. |
| 24 | // CHECK: int * __ptr32 __uptr p32_2; |
| 25 | int * __uptr __ptr32 p32_2; |
| 26 | |
| 27 | // CHECK: int * __ptr64 __sptr p64_2; |
| 28 | int * __sptr __ptr64 p64_2; |
| 29 | |
| 30 | // CHECK: int * __ptr32 __uptr p32_3; |
| 31 | int * __uptr __ptr32 p32_3; |
| 32 | |
| 33 | // CHECK: int * __sptr * __ptr32 ppsp32; |
| 34 | int * __sptr * __ptr32 ppsp32; |