// RUN: %clang_cc1 -verify -fopenmp -ast-dump %s | FileCheck %s -implicit-check-not=openmp_structured_block // RUN: %clang_cc1 -verify -fopenmp-simd -ast-dump %s | FileCheck %s -implicit-check-not=openmp_structured_block // expected-no-diagnostics int ga, gb; #pragma omp threadprivate(ga, gb) // CHECK: |-OMPThreadPrivateDecl {{.+}} col:1 // CHECK-NEXT: | |-DeclRefExpr {{.+}} 'int' lvalue Var {{.+}} 'ga' 'int' // CHECK-NEXT: | `-DeclRefExpr {{.+}} 'int' lvalue Var {{.+}} 'gb' 'int' #pragma omp declare reduction(+ : int, char : omp_out *= omp_in) #pragma omp declare reduction(fun : float : omp_out += omp_in) initializer(omp_priv = omp_orig + 15) // CHECK: |-OMPDeclareReductionDecl {{.+}} col:35 operator+ 'int' combiner 0x{{.+}} // CHECK-NEXT: | |-CompoundAssignOperator {{.+}} 'int' lvalue '*=' ComputeLHSTy='int' ComputeResultTy='int' // CHECK-NEXT: | | |-DeclRefExpr {{.+}} 'int' lvalue Var {{.+}} 'omp_out' 'int' // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'int' // CHECK-NEXT: | | `-DeclRefExpr {{.+}} 'int' lvalue Var {{.+}} 'omp_in' 'int' // CHECK-NEXT: | |-VarDecl {{.+}} col:35 implicit used omp_in 'int' // CHECK-NEXT: | `-VarDecl {{.+}} col:35 implicit used omp_out 'int' // CHECK-NEXT: |-OMPDeclareReductionDecl {{.+}} col:40 operator+ 'char' combiner 0x{{.+}} // CHECK-NEXT: | |-CompoundAssignOperator {{.+}} 'char' lvalue '*=' ComputeLHSTy='int' ComputeResultTy='int' // CHECK-NEXT: | | |-DeclRefExpr {{.+}} 'char' lvalue Var {{.+}} 'omp_out' 'char' // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'int' // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'char' // CHECK-NEXT: | | `-DeclRefExpr {{.+}} 'char' lvalue Var {{.+}} 'omp_in' 'char' // CHECK-NEXT: | |-VarDecl {{.+}} col:40 implicit used omp_in 'char' // CHECK-NEXT: | `-VarDecl {{.+}} col:40 implicit used omp_out 'char' // CHECK-NEXT: |-OMPDeclareReductionDecl {{.+}} col:37 fun 'float' combiner 0x{{.+}} initializer 0x{{.+}} // CHECK-NEXT: | |-CompoundAssignOperator {{.+}} 'float' lvalue '+=' ComputeLHSTy='float' ComputeResultTy='float' // CHECK-NEXT: | | |-DeclRefExpr {{.+}} 'float' lvalue Var {{.+}} 'omp_out' 'float' // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'float' // CHECK-NEXT: | | `-DeclRefExpr {{.+}} 'float' lvalue Var {{.+}} 'omp_in' 'float' // CHECK-NEXT: | |-BinaryOperator {{.+}} 'float' '+' // CHECK-NEXT: | | |-ImplicitCastExpr {{.+}} 'float' // CHECK-NEXT: | | | `-DeclRefExpr {{.+}} 'float' lvalue Var {{.+}} 'omp_orig' 'float' // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'float' // CHECK-NEXT: | | `-IntegerLiteral {{.+}} 'int' 15 struct S { int a, b; S() { #pragma omp parallel for default(none) private(a) shared(b) schedule(static, a) for (int i = 0; i < 0; ++i) ++a; } }; // CHECK: | `-OMPParallelForDirective {{.+}} {{|}} // CHECK-NEXT: | |-OMPDefaultClause {{.+}} // CHECK-NEXT: | |-OMPPrivateClause {{.+}} // CHECK-NEXT: | | `-DeclRefExpr {{.+}} 'int' lvalue OMPCapturedExpr {{.+}} 'a' 'int &' // CHECK-NEXT: | |-OMPSharedClause {{.+}} // CHECK-NEXT: | | `-MemberExpr {{.+}} 'int' lvalue ->b // CHECK-NEXT: | | `-CXXThisExpr {{.+}} 'S *' implicit this // CHECK-NEXT: | |-OMPScheduleClause {{.+}} // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'int' // CHECK-NEXT: | | `-DeclRefExpr {{.+}} 'int' lvalue OMPCapturedExpr {{.+}} '.capture_expr.' 'int' // CHECK-NEXT: | `-CapturedStmt {{.+}} // CHECK-NEXT: | |-CapturedDecl {{.+}} <> nothrow // CHECK-NEXT: | | |-ForStmt {{.+}} // CHECK: | | | `-UnaryOperator {{.+}} 'int' lvalue prefix '++' // CHECK-NEXT: | | | `-DeclRefExpr {{.+}} 'int' lvalue OMPCapturedExpr {{.+}} 'a' 'int &' #pragma omp declare simd #pragma omp declare simd inbranch void foo(); // CHECK: |-FunctionDecl {{.+}} col:6 foo 'void ()' // CHECK-NEXT: |-OMPDeclareSimdDeclAttr {{.+}} Implicit BS_Inbranch // CHECK: `-OMPDeclareSimdDeclAttr {{.+}} Implicit BS_Undefined #pragma omp declare target int bar() { int f; return f; } #pragma omp end declare target // CHECK: `-FunctionDecl {{.+}} line:[[@LINE-6]]:5 bar 'int ()' // CHECK-NEXT: |-CompoundStmt {{.+}} // CHECK-NEXT: | |-DeclStmt {{.+}} // CHECK-NEXT: | | `-VarDecl {{.+}} col:7 used f 'int' // CHECK-NEXT: | `-ReturnStmt {{.+}} // CHECK-NEXT: | `-ImplicitCastExpr {{.+}} 'int' // CHECK-NEXT: | `-DeclRefExpr {{.+}} 'int' lvalue Var {{.+}} 'f' 'int' // CHECK-NEXT: `-OMPDeclareTargetDeclAttr {{.+}} Implicit MT_To DT_Any 1