From 1ab6fcb7ef7c8e04eb7daa3383398f45a157bd43 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 1 Dec 2015 16:25:02 -0500 Subject: [PATCH 22/26] FIXME: fix g++.dg/gomp/loop-1.C --- gcc/cp/parser.c | 3 ++- gcc/testsuite/g++.dg/gomp/loop-1.C | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 8403a03..24aa454 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -32778,7 +32778,8 @@ cp_parser_omp_for_cond (cp_parser *parser, tree decl, enum tree_code code) || CLASS_TYPE_P (TREE_TYPE (decl)))) return cond; - return build_x_binary_op (input_location, TREE_CODE (cond), + return build_x_binary_op (EXPR_LOC_OR_LOC (cond, input_location), + TREE_CODE (cond), TREE_OPERAND (cond, 0), ERROR_MARK, TREE_OPERAND (cond, 1), ERROR_MARK, /*overload=*/NULL, tf_warning_or_error); diff --git a/gcc/testsuite/g++.dg/gomp/loop-1.C b/gcc/testsuite/g++.dg/gomp/loop-1.C index 46e707f..de08eb3 100644 --- a/gcc/testsuite/g++.dg/gomp/loop-1.C +++ b/gcc/testsuite/g++.dg/gomp/loop-1.C @@ -86,16 +86,16 @@ f1 (int x) for (j = baz (&i); j < 16; j += 2) ; #pragma omp for collapse(2) - for (i = 0; i < 16; i++) /* { dg-error "condition expression refers to iteration variable" } */ - for (j = 16; j > (i & x); j--) + for (i = 0; i < 16; i++) + for (j = 16; j > (i & x); j--) /* { dg-error "condition expression refers to iteration variable" } */ ; #pragma omp for collapse(2) - for (i = 0; i < 16; i++) /* { dg-error "condition expression refers to iteration variable" } */ - for (j = 0; j < i; j++) + for (i = 0; i < 16; i++) + for (j = 0; j < i; j++) /* { dg-error "condition expression refers to iteration variable" } */ ; #pragma omp for collapse(2) - for (i = 0; i < 16; i++) /* { dg-error "condition expression refers to iteration variable" } */ - for (j = 0; j < i + 4; j++) + for (i = 0; i < 16; i++) + for (j = 0; j < i + 4; j++) /* { dg-error "condition expression refers to iteration variable" } */ ; #pragma omp for collapse(2) for (i = 0; i < j + 4; i++) /* { dg-error "condition expression refers to iteration variable" } */ @@ -110,8 +110,8 @@ f1 (int x) for (j = 0; j < 16; j++) ; #pragma omp for collapse(2) - for (i = 0; i < 16; i++) /* { dg-error "condition expression refers to iteration variable" } */ - for (j = 0; j < baz (&i); j++) + for (i = 0; i < 16; i++) + for (j = 0; j < baz (&i); j++) /* { dg-error "condition expression refers to iteration variable" } */ ; #pragma omp for collapse(2) for (i = 0; i < 16; i += j) /* { dg-error "increment expression refers to iteration variable" } */ @@ -219,20 +219,20 @@ f2 (int x) for (int j = baz (&i); j < 16; j += 2) ; #pragma omp for collapse(2) - for (int i = 0; i < 16; i++) /* { dg-error "condition expression refers to iteration variable" } */ - for (int j = 16; j > (i & x); j--) + for (int i = 0; i < 16; i++) + for (int j = 16; j > (i & x); j--) /* { dg-error "condition expression refers to iteration variable" } */ ; #pragma omp for collapse(2) - for (int i = 0; i < 16; i++) /* { dg-error "condition expression refers to iteration variable" } */ - for (int j = 0; j < i; j++) + for (int i = 0; i < 16; i++) + for (int j = 0; j < i; j++) /* { dg-error "condition expression refers to iteration variable" } */ ; #pragma omp for collapse(2) - for (int i = 0; i < 16; i++) /* { dg-error "condition expression refers to iteration variable" } */ - for (int j = 0; j < i + 4; j++) + for (int i = 0; i < 16; i++) + for (int j = 0; j < i + 4; j++) /* { dg-error "condition expression refers to iteration variable" } */ ; #pragma omp for collapse(2) - for (int i = 0; i < 16; i++) /* { dg-error "condition expression refers to iteration variable" } */ - for (int j = 0; j < baz (&i); j++) + for (int i = 0; i < 16; i++) + for (int j = 0; j < baz (&i); j++) /* { dg-error "condition expression refers to iteration variable" } */ ; #pragma omp for collapse(2) for (int i = 0; i < 16; i++) /* { dg-error "increment expression refers to iteration variable" } */ -- 1.8.5.3