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 // CHECK-LABEL: NormalFunc
14 // CHECK-NEXT: CompoundStmt
16 #pragma acc set default_async(some_int()) device_num(some_long()) device_type(DT) if (some_int() < some_long())
17 // CHECK-NEXT: OpenACCSetConstruct{{.*}}set
18 // CHECK-NEXT: default_async clause
19 // CHECK-NEXT: CallExpr{{.*}}'int'
20 // CHECK-NEXT: ImplicitCastExpr
21 // CHECK-NEXT: DeclRefExpr{{.*}}'some_int' 'int ()'
22 // CHECK-NEXT: device_num clause
23 // CHECK-NEXT: CallExpr{{.*}} 'long'
24 // CHECK-NEXT: ImplicitCastExpr
25 // CHECK-NEXT: DeclRefExpr{{.*}}'some_long' 'long ()'
26 // CHECK-NEXT: device_type(DT)
27 // CHECK-NEXT: if clause
28 // CHECK-NEXT: BinaryOperator{{.*}}'bool' '<'
29 // CHECK-NEXT: ImplicitCastExpr{{.*}}'long'
30 // CHECK-NEXT: CallExpr{{.*}}'int'
31 // CHECK-NEXT: ImplicitCastExpr
32 // CHECK-NEXT: DeclRefExpr{{.*}}'some_int' 'int ()'
33 // CHECK-NEXT: CallExpr{{.*}} 'long'
34 // CHECK-NEXT: ImplicitCastExpr
35 // CHECK-NEXT: DeclRefExpr{{.*}}'some_long' 'long ()'
40 // CHECK-LABEL: FunctionTemplateDecl {{.*}}TemplFunc
41 // CHECK-NEXT: TemplateTypeParmDecl
42 // CHECK-NEXT: FunctionDecl{{.*}}TemplFunc
43 // CHECK-NEXT: ParmVarDecl{{.*}} t 'T'
44 // CHECK-NEXT: CompoundStmt
46 #pragma acc set default_async(T::value) device_num(t) device_type(DT) if (T::value < t)
47 // CHECK-NEXT: OpenACCSetConstruct{{.*}}set
48 // CHECK-NEXT: default_async clause
49 // CHECK-NEXT: DependentScopeDeclRefExpr{{.*}} '<dependent type>'
50 // CHECK-NEXT: NestedNameSpecifier TypeSpec 'T'
51 // CHECK-NEXT: device_num clause
52 // CHECK-NEXT: DeclRefExpr{{.*}}'t' 'T'
53 // CHECK-NEXT: device_type(DT)
54 // CHECK-NEXT: if clause
55 // CHECK-NEXT: BinaryOperator{{.*}}'<dependent type>' '<'
56 // CHECK-NEXT: DependentScopeDeclRefExpr{{.*}} '<dependent type>'
57 // CHECK-NEXT: NestedNameSpecifier TypeSpec 'T'
58 // CHECK-NEXT: DeclRefExpr{{.*}}'t' 'T'
61 // CHECK-NEXT: FunctionDecl{{.*}} TemplFunc 'void (SomeStruct)' implicit_instantiation
62 // CHECK-NEXT: TemplateArgument type 'SomeStruct'
63 // CHECK-NEXT: RecordType{{.*}} 'SomeStruct'
64 // CHECK-NEXT: CXXRecord{{.*}} 'SomeStruct'
65 // CHECK-NEXT: ParmVarDecl{{.*}} t 'SomeStruct'
66 // CHECK-NEXT: CompoundStmt
68 // CHECK-NEXT: OpenACCSetConstruct{{.*}}set
69 // CHECK-NEXT: default_async clause
70 // CHECK-NEXT: ImplicitCastExpr {{.*}}'unsigned int'
71 // CHECK-NEXT: DeclRefExpr{{.*}}'value' 'const unsigned int'
72 // CHECK-NEXT: NestedNameSpecifier TypeSpec 'SomeStruct'
73 // CHECK-NEXT: device_num clause
74 // CHECK-NEXT: ImplicitCastExpr {{.*}}'unsigned int'
75 // CHECK-NEXT: CXXMemberCallExpr{{.*}}'unsigned int'
76 // CHECK-NEXT: MemberExpr{{.*}}.operator unsigned int
77 // CHECK-NEXT: DeclRefExpr{{.*}}'t' 'SomeStruct'
78 // CHECK-NEXT: device_type(DT)
79 // CHECK-NEXT: if clause
80 // CHECK-NEXT: BinaryOperator{{.*}}'bool' '<'
81 // CHECK-NEXT: ImplicitCastExpr {{.*}}'unsigned int'
82 // CHECK-NEXT: DeclRefExpr{{.*}}'value' 'const unsigned int'
83 // CHECK-NEXT: NestedNameSpecifier TypeSpec 'SomeStruct'
84 // CHECK-NEXT: ImplicitCastExpr {{.*}}'unsigned int'
85 // CHECK-NEXT: CXXMemberCallExpr{{.*}}'unsigned int'
86 // CHECK-NEXT: MemberExpr{{.*}}.operator unsigned int
87 // CHECk-NEXT: DeclRefExpr{{.*}}'t' 'SomeStruct'
91 static constexpr unsigned value
= 5;
96 TemplFunc(SomeStruct
{});