1 | // RUN: %clang_cc1 %s -ast-dump | FileCheck %s |
2 | |
3 | // Veryify the ordering of the address_space attribute still comes before the |
4 | // type whereas other attributes are still printed after. |
5 | |
6 | template <int I> |
7 | void func() { |
8 | // CHECK: VarDecl {{.*}} x '__attribute__((address_space(1))) int *' |
9 | __attribute__((address_space(1))) int *x; |
10 | |
11 | // CHECK: VarDecl {{.*}} a 'int * __attribute__((noderef))' |
12 | int __attribute__((noderef)) * a; |
13 | |
14 | // CHECK: VarDecl {{.*}} y '__attribute__((address_space(2))) int *' |
15 | __attribute__((address_space(I))) int *y; |
16 | |
17 | // CHECK: VarDecl {{.*}} z '__attribute__((address_space(3))) int *' |
18 | [[clang::address_space(3)]] int *z; |
19 | } |
20 | |
21 | void func2() { |
22 | func<2>(); |
23 | } |
24 | |