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
10 void NormalUses(float *PointerParam
) {
11 // CHECK: FunctionDecl{{.*}}NormalUses
13 // CHECK-NEXT: CompoundStmt
15 #pragma acc parallel loop attach(PointerParam) deviceptr(PointerParam)
16 for (unsigned i
= 0; i
< 5; ++i
);
17 // CHECK-NEXT: OpenACCCombinedConstruct{{.*}} parallel loop
18 // CHECK-NEXT: attach clause
19 // CHECK-NEXT: DeclRefExpr{{.*}}'float *' lvalue ParmVar{{.*}} 'PointerParam' 'float *'
20 // CHECK-NEXT: deviceptr clause
21 // CHECK-NEXT: DeclRefExpr{{.*}}'float *' lvalue ParmVar{{.*}} 'PointerParam' 'float *'
22 // CHECK-NEXT: ForStmt
27 void TemplUses(T
*PointerParam
) {
28 // CHECK-NEXT: FunctionTemplateDecl
29 // CHECK-NEXT: TemplateTypeParmDecl{{.*}}typename depth 0 index 0 T
30 // CHECK-NEXT: FunctionDecl{{.*}} TemplUses 'void (T *)'
31 // CHECK-NEXT: ParmVarDecl{{.*}} referenced PointerParam 'T *'
32 // CHECK-NEXT: CompoundStmt
34 #pragma acc parallel loop attach(PointerParam) deviceptr(PointerParam)
35 for (unsigned i
= 0; i
< 5; ++i
);
36 // CHECK-NEXT: OpenACCCombinedConstruct{{.*}} parallel loop
37 // CHECK-NEXT: attach clause
38 // CHECK-NEXT: DeclRefExpr{{.*}}'T *' lvalue ParmVar{{.*}} 'PointerParam' 'T *'
39 // CHECK-NEXT: deviceptr clause
40 // CHECK-NEXT: DeclRefExpr{{.*}}'T *' lvalue ParmVar{{.*}} 'PointerParam' 'T *'
41 // CHECK-NEXT: ForStmt
44 // Check the instantiated versions of the above.
45 // CHECK-NEXT: FunctionDecl{{.*}} used TemplUses 'void (int *)' implicit_instantiation
46 // CHECK-NEXT: TemplateArgument type 'int'
47 // CHECK-NEXT: BuiltinType{{.*}} 'int'
48 // CHECK-NEXT: ParmVarDecl{{.*}} used PointerParam 'int *'
49 // CHECK-NEXT: CompoundStmt
51 //#pragma acc parallel loop attach(PointerParam) deviceptr(PointerParam)
52 // CHECK-NEXT: OpenACCCombinedConstruct{{.*}} parallel loop
53 // CHECK-NEXT: attach clause
54 // CHECK-NEXT: DeclRefExpr{{.*}}'int *' lvalue ParmVar{{.*}} 'PointerParam' 'int *'
55 // CHECK-NEXT: deviceptr clause
56 // CHECK-NEXT: DeclRefExpr{{.*}}'int *' lvalue ParmVar{{.*}} 'PointerParam' 'int *'
57 // CHECK-NEXT: ForStmt