[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / AST / ast-dump-openmp-ordered.c
blobc4427ee0eca3da29d905a16c7e165b68ae5dc4c8
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -ast-dump %s | FileCheck --match-full-lines -implicit-check-not=openmp_structured_block %s
3 void test_one(void) {
4 #pragma omp ordered
8 void test_two(int x) {
9 #pragma omp for ordered
10 for (int i = 0; i < x; i++)
14 void test_three(int x) {
15 #pragma omp for ordered(1)
16 for (int i = 0; i < x; i++) {
17 #pragma omp ordered depend(source)
21 // CHECK: TranslationUnitDecl {{.*}} <<invalid sloc>> <invalid sloc>
22 // CHECK: |-FunctionDecl {{.*}} <{{.*}}ast-dump-openmp-ordered.c:3:1, line:6:1> line:3:6 test_one 'void (void)'
23 // CHECK-NEXT: | `-CompoundStmt {{.*}} <col:21, line:6:1>
24 // CHECK-NEXT: | `-OMPOrderedDirective {{.*}} <line:4:1, col:20>
25 // CHECK-NEXT: | `-CapturedStmt {{.*}} <line:5:3>
26 // CHECK-NEXT: | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
27 // CHECK-NEXT: | |-NullStmt {{.*}} <col:3>
28 // CHECK-NEXT: | `-ImplicitParamDecl {{.*}} <line:4:1> col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-ordered.c:4:1) *const restrict'
29 // CHECK-NEXT: |-FunctionDecl {{.*}} <line:8:1, line:12:1> line:8:6 test_two 'void (int)'
30 // CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:15, col:19> col:19 used x 'int'
31 // CHECK-NEXT: | `-CompoundStmt {{.*}} <col:22, line:12:1>
32 // CHECK-NEXT: | `-OMPForDirective {{.*}} <line:9:1, col:24>
33 // CHECK-NEXT: | |-OMPOrderedClause {{.*}} <col:17, col:24>
34 // CHECK-NEXT: | | `-<<<NULL>>>
35 // CHECK-NEXT: | `-CapturedStmt {{.*}} <line:10:3, line:11:5>
36 // CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
37 // CHECK-NEXT: | | |-ForStmt {{.*}} <line:10:3, line:11:5>
38 // CHECK-NEXT: | | | |-DeclStmt {{.*}} <line:10:8, col:17>
39 // CHECK-NEXT: | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit
40 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0
41 // CHECK-NEXT: | | | |-<<<NULL>>>
42 // CHECK-NEXT: | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<'
43 // CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue>
44 // CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int'
45 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue>
46 // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int'
47 // CHECK-NEXT: | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++'
48 // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int'
49 // CHECK-NEXT: | | | `-NullStmt {{.*}} <line:11:5>
50 // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:9:1> col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-ordered.c:9:1) *const restrict'
51 // CHECK-NEXT: | | `-VarDecl {{.*}} <line:10:8, col:16> col:12 used i 'int' cinit
52 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:16> 'int' 0
53 // CHECK-NEXT: | `-DeclRefExpr {{.*}} <col:3> 'int' lvalue ParmVar {{.*}} 'x' 'int'
54 // CHECK-NEXT: `-FunctionDecl {{.*}} <line:14:1, line:19:1> line:14:6 test_three 'void (int)'
55 // CHECK-NEXT: |-ParmVarDecl {{.*}} <col:17, col:21> col:21 used x 'int'
56 // CHECK-NEXT: `-CompoundStmt {{.*}} <col:24, line:19:1>
57 // CHECK-NEXT: `-OMPForDirective {{.*}} <line:15:1, col:27>
58 // CHECK-NEXT: |-OMPOrderedClause {{.*}} <col:17, col:26>
59 // CHECK-NEXT: | `-ConstantExpr {{.*}} <col:25> 'int'
60 // CHECK-NEXT: | |-value: Int 1
61 // CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:25> 'int' 1
62 // CHECK-NEXT: `-CapturedStmt {{.*}} <line:16:3, line:18:3>
63 // CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
64 // CHECK-NEXT: | |-ForStmt {{.*}} <line:16:3, line:18:3>
65 // CHECK-NEXT: | | |-DeclStmt {{.*}} <line:16:8, col:17>
66 // CHECK-NEXT: | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit
67 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0
68 // CHECK-NEXT: | | |-<<<NULL>>>
69 // CHECK-NEXT: | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<'
70 // CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue>
71 // CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int'
72 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue>
73 // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int'
74 // CHECK-NEXT: | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++'
75 // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int'
76 // CHECK-NEXT: | | `-CompoundStmt {{.*}} <col:31, line:18:3>
77 // CHECK-NEXT: | | `-OMPOrderedDirective {{.*}} <line:17:1, col:35> openmp_standalone_directive
78 // CHECK-NEXT: | | `-OMPDependClause {{.*}} <col:21, <invalid sloc>>
79 // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <line:15:1> col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-ordered.c:15:1) *const restrict'
80 // CHECK-NEXT: | `-VarDecl {{.*}} <line:16:8, col:16> col:12 used i 'int' cinit
81 // CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:16> 'int' 0
82 // CHECK-NEXT: `-DeclRefExpr {{.*}} <col:3> 'int' lvalue ParmVar {{.*}} 'x' 'int'