Skip to content

Store the calculated constant expression value into the ConstantExpr … #3204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16227,7 +16227,8 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
if (Result)
*Result = E->EvaluateKnownConstIntCheckOverflow(Context);
if (!isa<ConstantExpr>(E))
E = ConstantExpr::Create(Context, E);
E = Result ? ConstantExpr::Create(Context, E, APValue(*Result))
: ConstantExpr::Create(Context, E);
return E;
}

Expand Down
5 changes: 3 additions & 2 deletions clang/test/AST/ast-dump-c-attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ struct [[deprecated]] Test4 {
// CHECK-NEXT: FieldDecl{{.*}}Test6
// CHECK-NEXT: DeprecatedAttr 0x{{[^ ]*}} <col:5, col:25> "Frobble" ""
// CHECK-NEXT: FieldDecl{{.*}}Test7
// CHECK-NEXT: Constant{{.*}}'int'
// CHECK-NEXT: IntegerLiteral{{.*}}'int' 12
// CHECK-NEXT: ConstantExpr{{.*}}'int'
// CHECK-NEXT: value: Int 12
// CHECK-NEXT: IntegerLiteral{{.*}}'int' 12
// CHECK-NEXT: DeprecatedAttr 0x{{[^ ]*}} <col:15> "" ""

struct [[deprecated]] Test8;
Expand Down
2 changes: 2 additions & 0 deletions clang/test/AST/ast-dump-decl-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "1",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
Expand Down Expand Up @@ -1668,6 +1669,7 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "1",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
Expand Down
6 changes: 4 additions & 2 deletions clang/test/AST/ast-dump-decl.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ enum testEnumConstantDecl {
// CHECK: EnumConstantDecl{{.*}} TestEnumConstantDecl 'int'
// CHECK: EnumConstantDecl{{.*}} TestEnumConstantDeclInit 'int'
// CHECK-NEXT: ConstantExpr
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: value: Int 1
// CHECK-NEXT: IntegerLiteral

struct testIndirectFieldDecl {
struct {
Expand Down Expand Up @@ -160,7 +161,8 @@ struct testFieldDecl {
// CHECK: FieldDecl{{.*}} TestFieldDecl 'int'
// CHECK: FieldDecl{{.*}} TestFieldDeclWidth 'int'
// CHECK-NEXT: ConstantExpr
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: value: Int 1
// CHECK-NEXT: IntegerLiteral
// CHECK-MODULE: FieldDecl{{.*}} TestFieldDeclPrivate 'int' __module_private__

int TestVarDecl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPDistributeParallelForSimdDirective {{.*}} <line:17:1, col:53>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:42, col:52>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:51> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:51> 'int' 1
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:18:3, line:20:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down Expand Up @@ -159,6 +160,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPDistributeParallelForSimdDirective {{.*}} <line:24:1, col:53>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:42, col:52>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:51> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:51> 'int' 2
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:25:3, line:27:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down Expand Up @@ -206,6 +208,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPDistributeParallelForSimdDirective {{.*}} <line:31:1, col:53>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:42, col:52>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:51> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:51> 'int' 2
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:32:3, line:35:9>
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/ast-dump-openmp-distribute-parallel-for.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPDistributeParallelForDirective {{.*}} <line:17:1, col:48>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:37, col:47>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:46> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:46> 'int' 1
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:18:3, line:20:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down Expand Up @@ -159,6 +160,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPDistributeParallelForDirective {{.*}} <line:24:1, col:48>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:37, col:47>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:46> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:46> 'int' 2
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:25:3, line:27:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down Expand Up @@ -206,6 +208,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPDistributeParallelForDirective {{.*}} <line:31:1, col:48>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:37, col:47>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:46> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:46> 'int' 2
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:32:3, line:35:9>
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/ast-dump-openmp-distribute-simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPDistributeSimdDirective {{.*}} <line:17:1, col:40>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:29, col:39>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:38> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:38> 'int' 1
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:18:3, line:20:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down Expand Up @@ -147,6 +148,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPDistributeSimdDirective {{.*}} <line:24:1, col:40>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:29, col:39>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:38> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:38> 'int' 2
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:25:3, line:27:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down Expand Up @@ -190,6 +192,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPDistributeSimdDirective {{.*}} <line:31:1, col:40>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:29, col:39>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:38> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:38> 'int' 2
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:32:3, line:35:9>
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/ast-dump-openmp-distribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPDistributeDirective {{.*}} <line:17:1, col:35>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:24, col:34>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:33> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:33> 'int' 1
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:18:3, line:20:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down Expand Up @@ -147,6 +148,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPDistributeDirective {{.*}} <line:24:1, col:35>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:24, col:34>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:33> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:33> 'int' 2
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:25:3, line:27:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down Expand Up @@ -190,6 +192,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPDistributeDirective {{.*}} <line:31:1, col:35>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:24, col:34>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:33> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:33> 'int' 2
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:32:3, line:35:9>
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/ast-dump-openmp-for-simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPForSimdDirective {{.*}} <line:17:1, col:33>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:22, col:32>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:31> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:31> 'int' 1
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:18:3, line:20:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down Expand Up @@ -147,6 +148,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPForSimdDirective {{.*}} <line:24:1, col:33>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:22, col:32>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:31> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:31> 'int' 2
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:25:3, line:27:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down Expand Up @@ -190,6 +192,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPForSimdDirective {{.*}} <line:31:1, col:33>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:22, col:32>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:31> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:31> 'int' 2
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:32:3, line:35:9>
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/ast-dump-openmp-for.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPForDirective {{.*}} <line:17:1, col:28>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:17, col:27>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:26> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:26> 'int' 1
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:18:3, line:20:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down Expand Up @@ -147,6 +148,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPForDirective {{.*}} <line:24:1, col:28>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:17, col:27>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:26> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:26> 'int' 2
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:25:3, line:27:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down Expand Up @@ -190,6 +192,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPForDirective {{.*}} <line:31:1, col:28>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:17, col:27>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:26> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:26> 'int' 2
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:32:3, line:35:9>
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down
1 change: 1 addition & 0 deletions clang/test/AST/ast-dump-openmp-ordered.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void test_three(int x) {
// CHECK-NEXT: `-OMPForDirective {{.*}} <line:15:1, col:27>
// CHECK-NEXT: |-OMPOrderedClause {{.*}} <col:17, col:26>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:25> 'int'
// CHECK-NEXT: | |-value: Int 1
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:25> 'int' 1
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:16:3, line:18:3>
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/ast-dump-openmp-parallel-for-simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPParallelForSimdDirective {{.*}} <line:17:1, col:42>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:31, col:41>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:40> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:40> 'int' 1
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:18:3, line:20:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down Expand Up @@ -153,6 +154,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPParallelForSimdDirective {{.*}} <line:24:1, col:42>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:31, col:41>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:40> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:40> 'int' 2
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:25:3, line:27:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down Expand Up @@ -198,6 +200,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPParallelForSimdDirective {{.*}} <line:31:1, col:42>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:31, col:41>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:40> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:40> 'int' 2
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:32:3, line:35:9>
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/ast-dump-openmp-parallel-for.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPParallelForDirective {{.*}} <line:17:1, col:37>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:26, col:36>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:35> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:35> 'int' 1
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:18:3, line:20:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down Expand Up @@ -153,6 +154,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPParallelForDirective {{.*}} <line:24:1, col:37>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:26, col:36>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:35> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:35> 'int' 2
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:25:3, line:27:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down Expand Up @@ -198,6 +200,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPParallelForDirective {{.*}} <line:31:1, col:37>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:26, col:36>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:35> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:35> 'int' 2
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:32:3, line:35:9>
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/ast-dump-openmp-simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPSimdDirective {{.*}} <line:17:1, col:29>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:18, col:28>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:27> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:27> 'int' 1
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:18:3, line:20:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down Expand Up @@ -147,6 +148,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPSimdDirective {{.*}} <line:24:1, col:29>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:18, col:28>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:27> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:27> 'int' 2
// CHECK-NEXT: | `-CapturedStmt {{.*}} <line:25:3, line:27:7>
// CHECK-NEXT: | |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down Expand Up @@ -190,6 +192,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPSimdDirective {{.*}} <line:31:1, col:29>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:18, col:28>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:27> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:27> 'int' 2
// CHECK-NEXT: `-CapturedStmt {{.*}} <line:32:3, line:35:9>
// CHECK-NEXT: |-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc>
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/ast-dump-openmp-target-parallel-for-simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPTargetParallelForSimdDirective {{.*}} <line:17:1, col:49>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:38, col:48>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:47> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:47> 'int' 1
// CHECK-NEXT: | |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit>
// CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:18:23> 'int' lvalue ParmVar {{.*}} 'x' 'int'
Expand Down Expand Up @@ -524,6 +525,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPTargetParallelForSimdDirective {{.*}} <line:24:1, col:49>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:38, col:48>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:47> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:47> 'int' 2
// CHECK-NEXT: | |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit>
// CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:25:23> 'int' lvalue ParmVar {{.*}} 'x' 'int'
Expand Down Expand Up @@ -710,6 +712,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPTargetParallelForSimdDirective {{.*}} <line:31:1, col:49>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:38, col:48>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:47> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:47> 'int' 2
// CHECK-NEXT: |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit>
// CHECK-NEXT: | |-DeclRefExpr {{.*}} <line:32:23> 'int' lvalue ParmVar {{.*}} 'x' 'int'
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/ast-dump-openmp-target-parallel-for.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPTargetParallelForDirective {{.*}} <line:17:1, col:44>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:33, col:43>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:42> 'int'
// CHECK-NEXT: | | |-value: Int 1
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:42> 'int' 1
// CHECK-NEXT: | |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit>
// CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:18:23> 'int' lvalue ParmVar {{.*}} 'x' 'int'
Expand Down Expand Up @@ -524,6 +525,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: | `-OMPTargetParallelForDirective {{.*}} <line:24:1, col:44>
// CHECK-NEXT: | |-OMPCollapseClause {{.*}} <col:33, col:43>
// CHECK-NEXT: | | `-ConstantExpr {{.*}} <col:42> 'int'
// CHECK-NEXT: | | |-value: Int 2
// CHECK-NEXT: | | `-IntegerLiteral {{.*}} <col:42> 'int' 2
// CHECK-NEXT: | |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit>
// CHECK-NEXT: | | |-DeclRefExpr {{.*}} <line:25:23> 'int' lvalue ParmVar {{.*}} 'x' 'int'
Expand Down Expand Up @@ -710,6 +712,7 @@ void test_five(int x, int y, int z) {
// CHECK-NEXT: `-OMPTargetParallelForDirective {{.*}} <line:31:1, col:44>
// CHECK-NEXT: |-OMPCollapseClause {{.*}} <col:33, col:43>
// CHECK-NEXT: | `-ConstantExpr {{.*}} <col:42> 'int'
// CHECK-NEXT: | |-value: Int 2
// CHECK-NEXT: | `-IntegerLiteral {{.*}} <col:42> 'int' 2
// CHECK-NEXT: |-OMPFirstprivateClause {{.*}} <<invalid sloc>> <implicit>
// CHECK-NEXT: | |-DeclRefExpr {{.*}} <line:32:23> 'int' lvalue ParmVar {{.*}} 'x' 'int'
Expand Down
Loading