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 parallel loop present(GlobalArray, PointerParam[Global])
19 for(int i
= 0; i
< 5; ++i
);
20 // CHECK-NEXT: OpenACCCombinedConstruct{{.*}} parallel loop
21 // CHECK-NEXT: present clause
22 // CHECK-NEXT: DeclRefExpr{{.*}}'short[5]' lvalue Var{{.*}}'GlobalArray' 'short[5]'
23 // CHECK-NEXT: ArraySubscriptExpr{{.*}}'float' lvalue
24 // CHECK-NEXT: ImplicitCastExpr{{.*}} 'float *' <LValueToRValue>
25 // CHECK-NEXT: DeclRefExpr{{.*}}'float *' lvalue ParmVar{{.*}}'PointerParam' 'float *'
26 // CHECK-NEXT: ImplicitCastExpr{{.*}} 'int' <LValueToRValue>
27 // CHECK-NEXT: DeclRefExpr{{.*}}'int' lvalue Var{{.*}}'Global' 'int'
28 // CHECK-NEXT: ForStmt
32 template<auto &NTTP
, typename T
>
34 // CHECK-NEXT: FunctionTemplateDecl
35 // CHECK-NEXT: NonTypeTemplateParmDecl {{.*}}referenced 'auto &' depth 0 index 0 NTTP
36 // CHECK-NEXT: TemplateTypeParmDecl{{.*}}typename depth 0 index 1 T
37 // CHECK-NEXT: FunctionDecl{{.*}} TemplUses 'void (T)'
38 // CHECK-NEXT: ParmVarDecl{{.*}} referenced t 'T'
39 // CHECK-NEXT: CompoundStmt
41 #pragma acc serial loop seq present(NTTP, t)
42 for(int i
= 0; i
< 5; ++i
);
43 // CHECK-NEXT: OpenACCCombinedConstruct{{.*}} serial loop
44 // CHECK-NEXT: seq clause
45 // CHECK-NEXT: present clause
46 // CHECK-NEXT: DeclRefExpr{{.*}}'auto' lvalue NonTypeTemplateParm{{.*}} 'NTTP' 'auto &'
47 // CHECK-NEXT: DeclRefExpr{{.*}}'T' lvalue ParmVar{{.*}} 't' 'T'
48 // CHECK-NEXT: ForStmt
52 // Check the instantiated versions of the above.
53 // CHECK-NEXT: FunctionDecl{{.*}} used TemplUses 'void (int)' implicit_instantiation
54 // CHECK-NEXT: TemplateArgument decl
55 // CHECK-NEXT: Var{{.*}} 'CEVar' 'const unsigned int'
56 // CHECK-NEXT: TemplateArgument type 'int'
57 // CHECK-NEXT: BuiltinType{{.*}} 'int'
58 // CHECK-NEXT: ParmVarDecl{{.*}} used t 'int'
59 // CHECK-NEXT: CompoundStmt
61 // #pragma acc parallel seq present(NTTP, t)
62 // CHECK-NEXT: OpenACCCombinedConstruct{{.*}} serial loop
63 // CHECK-NEXT: seq clause
64 // CHECK-NEXT: present clause
65 // CHECK-NEXT: SubstNonTypeTemplateParmExpr{{.*}}'const unsigned int' lvalue
66 // CHECK-NEXT: NonTypeTemplateParmDecl{{.*}} referenced 'auto &' depth 0 index 0 NTTP
67 // CHECK-NEXT: DeclRefExpr{{.*}}'const unsigned int' lvalue Var{{.*}} 'CEVar' 'const unsigned int'
68 // CHECK-NEXT: DeclRefExpr{{.*}}'int' lvalue ParmVar{{.*}} 't' 'int'
69 // CHECK-NEXT: ForStmt
75 static constexpr unsigned CEVar
= 1;