2019-03-21 00:31:47 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -ast-dump %s | FileCheck --match-full-lines -implicit-check-not=openmp_structured_block %s
|
|
|
|
|
|
|
|
void test_one() {
|
|
|
|
#pragma omp ordered
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
void test_two(int x) {
|
|
|
|
#pragma omp for ordered
|
|
|
|
for (int i = 0; i < x; i++)
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
void test_three(int x) {
|
|
|
|
#pragma omp for ordered(1)
|
|
|
|
for (int i = 0; i < x; i++) {
|
|
|
|
#pragma omp ordered depend(source)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: TranslationUnitDecl {{.*}} <<invalid sloc>> <invalid sloc>
|
|
|
|
// CHECK: |-FunctionDecl {{.*}} <{{.*}}ast-dump-openmp-ordered.c:3:1, line:6:1> line:3:6 test_one 'void ()'
|
|
|
|
// CHECK-NEXT: | `-CompoundStmt {{.*}} <col:17, line:6:1>
|
2019-05-29 03:27:19 +08:00
|
|
|
// CHECK-NEXT: | `-OMPOrderedDirective {{.*}} <line:4:1, col:20>
|
2019-03-21 00:31:47 +08:00
|
|
|
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:5:3>
|
|
|
|
// CHECK-NEXT: | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
|
2020-03-12 17:18:01 +08:00
|
|
|
// CHECK-NEXT: | |-NullStmt {{.*}} <col:3>
|
2021-02-23 01:58:26 +08:00
|
|
|
// CHECK-NEXT: | `-ImplicitParamDecl {{.*}} <line:4:1> col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-ordered.c:4:1) *const restrict'
|
2019-03-21 00:31:47 +08:00
|
|
|
// CHECK-NEXT: |-FunctionDecl {{.*}} <line:8:1, line:12:1> line:8:6 test_two 'void (int)'
|
|
|
|
// CHECK-NEXT: | |-ParmVarDecl {{.*}} <col:15, col:19> col:19 used x 'int'
|
|
|
|
// CHECK-NEXT: | `-CompoundStmt {{.*}} <col:22, line:12:1>
|
2019-05-29 03:27:19 +08:00
|
|
|
// CHECK-NEXT: | `-OMPForDirective {{.*}} <line:9:1, col:24>
|
2019-03-21 00:31:47 +08:00
|
|
|
// CHECK-NEXT: | |-OMPOrderedClause {{.*}} <col:17, col:24>
|
|
|
|
// CHECK-NEXT: | | `-<<<NULL>>>
|
|
|
|
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:10:3, line:11:5>
|
|
|
|
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
|
|
|
|
// CHECK-NEXT: | | |-ForStmt {{.*}} <line:10:3, line:11:5>
|
|
|
|
// CHECK-NEXT: | | | |-DeclStmt {{.*}} <line:10:8, col:17>
|
|
|
|
// CHECK-NEXT: | | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit
|
|
|
|
// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0
|
|
|
|
// CHECK-NEXT: | | | |-<<<NULL>>>
|
|
|
|
// CHECK-NEXT: | | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<'
|
|
|
|
// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue>
|
|
|
|
// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int'
|
|
|
|
// CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue>
|
|
|
|
// CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int'
|
|
|
|
// CHECK-NEXT: | | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++'
|
|
|
|
// CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int'
|
2020-03-12 17:18:01 +08:00
|
|
|
// CHECK-NEXT: | | | `-NullStmt {{.*}} <line:11:5>
|
2021-02-23 01:58:26 +08:00
|
|
|
// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} <line:9:1> col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-ordered.c:9:1) *const restrict'
|
2019-03-21 00:31:47 +08:00
|
|
|
// CHECK-NEXT: | | `-VarDecl {{.*}} <line:10:8, col:16> col:12 used i 'int' cinit
|
|
|
|
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:16> 'int' 0
|
|
|
|
// CHECK-NEXT: | `-DeclRefExpr {{.*}} <col:3> 'int' lvalue ParmVar {{.*}} 'x' 'int'
|
|
|
|
// CHECK-NEXT: `-FunctionDecl {{.*}} <line:14:1, line:19:1> line:14:6 test_three 'void (int)'
|
|
|
|
// CHECK-NEXT: |-ParmVarDecl {{.*}} <col:17, col:21> col:21 used x 'int'
|
|
|
|
// CHECK-NEXT: `-CompoundStmt {{.*}} <col:24, line:19:1>
|
2019-05-29 03:27:19 +08:00
|
|
|
// CHECK-NEXT: `-OMPForDirective {{.*}} <line:15:1, col:27>
|
2019-03-21 00:31:47 +08:00
|
|
|
// CHECK-NEXT: |-OMPOrderedClause {{.*}} <col:17, col:26>
|
|
|
|
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:25> 'int'
|
2021-02-11 23:12:38 +08:00
|
|
|
// CHECK-NEXT: | |-value: Int 1
|
2019-03-21 00:31:47 +08:00
|
|
|
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:25> 'int' 1
|
|
|
|
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:16:3, line:18:3>
|
|
|
|
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
|
|
|
|
// CHECK-NEXT: | |-ForStmt {{.*}} <line:16:3, line:18:3>
|
|
|
|
// CHECK-NEXT: | | |-DeclStmt {{.*}} <line:16:8, col:17>
|
|
|
|
// CHECK-NEXT: | | | `-VarDecl {{.*}} <col:8, col:16> col:12 used i 'int' cinit
|
|
|
|
// CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <col:16> 'int' 0
|
|
|
|
// CHECK-NEXT: | | |-<<<NULL>>>
|
|
|
|
// CHECK-NEXT: | | |-BinaryOperator {{.*}} <col:19, col:23> 'int' '<'
|
|
|
|
// CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} <col:19> 'int' <LValueToRValue>
|
|
|
|
// CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} <col:19> 'int' lvalue Var {{.*}} 'i' 'int'
|
|
|
|
// CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <col:23> 'int' <LValueToRValue>
|
|
|
|
// CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:23> 'int' lvalue ParmVar {{.*}} 'x' 'int'
|
|
|
|
// CHECK-NEXT: | | |-UnaryOperator {{.*}} <col:26, col:27> 'int' postfix '++'
|
|
|
|
// CHECK-NEXT: | | | `-DeclRefExpr {{.*}} <col:26> 'int' lvalue Var {{.*}} 'i' 'int'
|
2020-03-12 17:18:01 +08:00
|
|
|
// CHECK-NEXT: | | `-CompoundStmt {{.*}} <col:31, line:18:3>
|
2019-05-29 03:27:19 +08:00
|
|
|
// CHECK-NEXT: | | `-OMPOrderedDirective {{.*}} <line:17:1, col:35> openmp_standalone_directive
|
[OPENMP]Redesign of OMPExecutableDirective/OMPDeclarativeDirective representation.
Summary:
Introduced OMPChildren class to handle all associated clauses, statement
and child expressions/statements. It allows to represent some directives
more correctly (like flush, depobj etc. with pseudo clauses, ordered
depend directives, which are standalone, and target data directives).
Also, it will make easier to avoid using of CapturedStmt in directives,
if required (atomic, tile etc. directives).
Also, it simplifies serialization/deserialization of the
executable/declarative directives.
Reduces number of allocation operations for mapper declarations.
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, jfb, cfe-commits, sstefan1, aaron.ballman, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83261
2020-06-27 05:42:31 +08:00
|
|
|
// CHECK-NEXT: | | `-OMPDependClause {{.*}} <col:21, <invalid sloc>>
|
2021-02-23 01:58:26 +08:00
|
|
|
// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} <line:15:1> col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-ordered.c:15:1) *const restrict'
|
2019-03-21 00:31:47 +08:00
|
|
|
// CHECK-NEXT: | `-VarDecl {{.*}} <line:16:8, col:16> col:12 used i 'int' cinit
|
|
|
|
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:16> 'int' 0
|
|
|
|
// CHECK-NEXT: `-DeclRefExpr {{.*}} <col:3> 'int' lvalue ParmVar {{.*}} 'x' 'int'
|