1 // RUN: %clang_cc1 %s -fopenacc -ast-dump | FileCheck %s
4 // RUN: %clang_cc1 %s -fopenacc -emit-pch -o %t %s
5 // RUN: %clang_cc1 %s -fopenacc -include-pch %t -ast-dump-all | FileCheck %s
13 void NormalUses(float *PointerParam
) {
14 // CHECK: FunctionDecl{{.*}}NormalUses
16 // CHECK-NEXT: CompoundStmt
18 #pragma acc data default(present) deviceptr(PointerParam)
19 for(int i
= 0; i
< 5; ++i
);
20 // CHECK-NEXT: OpenACCDataConstruct{{.*}} data
21 // CHECK-NEXT: default(present)
22 // CHECK-NEXT: deviceptr clause
23 // CHECK-NEXT: DeclRefExpr{{.*}}'float *' lvalue ParmVar{{.*}} 'PointerParam' 'float *'
24 // CHECK-NEXT: ForStmt
29 void TemplUses(T
*t
) {
30 // CHECK-NEXT: FunctionTemplateDecl
31 // CHECK-NEXT: TemplateTypeParmDecl{{.*}}typename depth 0 index 0 T
32 // CHECK-NEXT: FunctionDecl{{.*}} TemplUses 'void (T *)'
33 // CHECK-NEXT: ParmVarDecl{{.*}} referenced t 'T *'
34 // CHECK-NEXT: CompoundStmt
36 #pragma acc data default(present) deviceptr(t)
37 for(int i
= 0; i
< 5; ++i
);
38 // CHECK-NEXT: OpenACCDataConstruct{{.*}} data
39 // CHECK-NEXT: default(present)
40 // CHECK-NEXT: deviceptr clause
41 // CHECK-NEXT: DeclRefExpr{{.*}}'T *' lvalue ParmVar{{.*}} 't' 'T *'
42 // CHECK-NEXT: ForStmt
46 // Check the instantiated versions of the above.
47 // CHECK-NEXT: FunctionDecl{{.*}} used TemplUses 'void (int *)' implicit_instantiation
48 // CHECK-NEXT: TemplateArgument type 'int'
49 // CHECK-NEXT: BuiltinType{{.*}} 'int'
50 // CHECK-NEXT: ParmVarDecl{{.*}} used t 'int *'
51 // CHECK-NEXT: CompoundStmt
53 // CHECK-NEXT: OpenACCDataConstruct{{.*}} data
54 // CHECK-NEXT: default(present)
55 // CHECK-NEXT: deviceptr clause
56 // CHECK-NEXT: DeclRefExpr{{.*}}'int *' lvalue ParmVar{{.*}} 't' 'int *'
57 // CHECK-NEXT: ForStmt