xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/attr-print.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // CHECK: int x __attribute__((aligned(4)));
4*f4a2713aSLionel Sambuc int x __attribute__((aligned(4)));
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc // FIXME: Print this at a valid location for a __declspec attr.
7*f4a2713aSLionel Sambuc // CHECK: int y __declspec(align(4));
8*f4a2713aSLionel Sambuc __declspec(align(4)) int y;
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc // CHECK: void foo() __attribute__((const));
11*f4a2713aSLionel Sambuc void foo() __attribute__((const));
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc // CHECK: void bar() __attribute__((__const));
14*f4a2713aSLionel Sambuc void bar() __attribute__((__const));
15*f4a2713aSLionel Sambuc 
16*f4a2713aSLionel Sambuc // CHECK: int * __ptr32 p32;
17*f4a2713aSLionel Sambuc int * __ptr32 p32;
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc // CHECK: int * __ptr64 p64;
20*f4a2713aSLionel Sambuc int * __ptr64 p64;
21*f4a2713aSLionel Sambuc 
22*f4a2713aSLionel Sambuc // TODO: the Type Printer has no way to specify the order to print attributes
23*f4a2713aSLionel Sambuc // in, and so it currently always prints them in reverse order. Fix this.
24*f4a2713aSLionel Sambuc // CHECK: int * __ptr32 __uptr p32_2;
25*f4a2713aSLionel Sambuc int * __uptr __ptr32 p32_2;
26*f4a2713aSLionel Sambuc 
27*f4a2713aSLionel Sambuc // CHECK: int * __ptr64 __sptr p64_2;
28*f4a2713aSLionel Sambuc int * __sptr __ptr64 p64_2;
29*f4a2713aSLionel Sambuc 
30*f4a2713aSLionel Sambuc // CHECK: int * __ptr32 __uptr p32_3;
31*f4a2713aSLionel Sambuc int * __uptr __ptr32 p32_3;
32*f4a2713aSLionel Sambuc 
33*f4a2713aSLionel Sambuc // CHECK: int * __sptr * __ptr32 ppsp32;
34*f4a2713aSLionel Sambuc int * __sptr * __ptr32 ppsp32;
35