aboutsummaryrefslogtreecommitdiff
path: root/clang/test/OpenMP/task_transparent_serialization.cpp
blob: 110bd608b41abd609297c318c949f52765530920 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// RUN: %clang_cc1 -fopenmp -fopenmp-version=60 -x c++ -std=c++11 -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -fopenmp-version=60 -x c++ -std=c++11 -include-pch %t -ast-dump-all  %s | FileCheck %s

// expected-no-diagnostics
#ifndef HEADER
#define HEADER

typedef void **omp_impex_t;
extern const omp_impex_t omp_not_impex;
extern const omp_impex_t omp_import;
extern const omp_impex_t omp_export;
extern const omp_impex_t omp_impex;

template <typename T>
class TransparentTemplate {
public:
  void TestTaskLoopImpex() {
    #pragma omp taskloop transparent(omp_impex)
    for (int i = 0; i < 10; ++i) {}
  }
};

void TestTaskTransparent() {
  int a;
  omp_impex_t imp;
#pragma omp task transparent(omp_not_impex)
#pragma omp task transparent(imp)

#pragma omp parallel
  {
#pragma omp task transparent(omp_export)
    {
#pragma omp taskloop transparent(omp_impex)
      for (int i = 0; i < 5; ++i) {}
    }
  }
  TransparentTemplate<int> obj;
  obj.TestTaskLoopImpex();
}
#endif


// CHECK: FunctionDecl {{.*}} TestTaskTransparent 'void ()'
// CHECK: OMPTaskDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_not_impex' 'const omp_impex_t':'void **const'
// CHECK-NEXT: OMPFirstprivateClause
// CHECK-NEXT: DeclRefExpr {{.*}} 'omp_impex_t':'void **' lvalue Var {{.*}} 'imp' 'omp_impex_t':'void **' refers_to_enclosing_variable_or_capture
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'omp_impex_t':'void **' lvalue Var {{.*}} 'imp' 'omp_impex_t':'void **' refers_to_enclosing_variable_or_capture
// CHECK-NEXT: CapturedStmt
// CHECK:  OMPTaskDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_export' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskLoopDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_impex' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskLoopDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_impex' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_export' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskLoopDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_impex' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskLoopDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_impex' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_export' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskLoopDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_impex' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskLoopDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_impex' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_export' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskLoopDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_impex' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt
// CHECK: OMPTaskLoopDirective
// CHECK-NEXT: OMPTransparentClause
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'omp_impex_t':'void **' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr {{.*}} 'const omp_impex_t':'void **const' lvalue Var {{.*}} 'omp_impex' 'const omp_impex_t':'void **const'
// CHECK-NEXT: CapturedStmt