Skip to content

Commit 1be6340

Browse files
committed
[OPENMP] Update the diagnosis message for canonical loop form, by Chi
Chun Chen. The previous patch (https://reviews.llvm.org/D54441) support the relational-op != very well for openmp canonical loop form, however, it didn't update the diagnosis message. So this patch is simply update the diagnosis message by adding !=, update the test related to it, and update the section number for canonical loop form for OpenMP 5.0 in comment. Differential Revision: https://reviews.llvm.org/D66559 llvm-svn: 371631
1 parent 00c1ee4 commit 1be6340

24 files changed

+368
-319
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9094,7 +9094,7 @@ def ext_omp_loop_not_canonical_init : ExtWarn<
90949094
"('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
90959095
def err_omp_loop_not_canonical_cond : Error<
90969096
"condition of OpenMP for loop must be a relational comparison "
9097-
"('<', '<=', '>', or '>=') of loop variable %0">;
9097+
"('<', '<=', '>', %select{or '>='|'>=', or '!='}0) of loop variable %1">;
90989098
def err_omp_loop_not_canonical_incr : Error<
90999099
"increment clause of OpenMP for loop must perform simple addition "
91009100
"or subtraction on loop variable %0">;

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5416,12 +5416,14 @@ static const ValueDecl *getInitLCDecl(const Expr *E) {
54165416
bool OpenMPIterationSpaceChecker::checkAndSetCond(Expr *S) {
54175417
// Check test-expr for canonical form, save upper-bound UB, flags for
54185418
// less/greater and for strict/non-strict comparison.
5419-
// OpenMP [2.6] Canonical loop form. Test-expr may be one of the following:
5419+
// OpenMP [2.9] Canonical loop form. Test-expr may be one of the following:
54205420
// var relational-op b
54215421
// b relational-op var
54225422
//
5423+
bool IneqCondIsCanonical = SemaRef.getLangOpts().OpenMP >= 50;
54235424
if (!S) {
5424-
SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_cond) << LCDecl;
5425+
SemaRef.Diag(DefaultLoc, diag::err_omp_loop_not_canonical_cond)
5426+
<< (IneqCondIsCanonical ? 1 : 0) << LCDecl;
54255427
return true;
54265428
}
54275429
Condition = S;
@@ -5439,12 +5441,11 @@ bool OpenMPIterationSpaceChecker::checkAndSetCond(Expr *S) {
54395441
(BO->getOpcode() == BO_GT || BO->getOpcode() == BO_GE),
54405442
(BO->getOpcode() == BO_LT || BO->getOpcode() == BO_GT),
54415443
BO->getSourceRange(), BO->getOperatorLoc());
5442-
} else if (BO->getOpcode() == BO_NE)
5443-
return setUB(getInitLCDecl(BO->getLHS()) == LCDecl ?
5444-
BO->getRHS() : BO->getLHS(),
5445-
/*LessOp=*/llvm::None,
5446-
/*StrictOp=*/true,
5447-
BO->getSourceRange(), BO->getOperatorLoc());
5444+
} else if (IneqCondIsCanonical && BO->getOpcode() == BO_NE)
5445+
return setUB(
5446+
getInitLCDecl(BO->getLHS()) == LCDecl ? BO->getRHS() : BO->getLHS(),
5447+
/*LessOp=*/llvm::None,
5448+
/*StrictOp=*/true, BO->getSourceRange(), BO->getOperatorLoc());
54485449
} else if (auto *CE = dyn_cast<CXXOperatorCallExpr>(S)) {
54495450
if (CE->getNumArgs() == 2) {
54505451
auto Op = CE->getOperator();
@@ -5463,12 +5464,12 @@ bool OpenMPIterationSpaceChecker::checkAndSetCond(Expr *S) {
54635464
CE->getOperatorLoc());
54645465
break;
54655466
case OO_ExclaimEqual:
5466-
return setUB(getInitLCDecl(CE->getArg(0)) == LCDecl ?
5467-
CE->getArg(1) : CE->getArg(0),
5468-
/*LessOp=*/llvm::None,
5469-
/*StrictOp=*/true,
5470-
CE->getSourceRange(),
5471-
CE->getOperatorLoc());
5467+
if (IneqCondIsCanonical)
5468+
return setUB(getInitLCDecl(CE->getArg(0)) == LCDecl ? CE->getArg(1)
5469+
: CE->getArg(0),
5470+
/*LessOp=*/llvm::None,
5471+
/*StrictOp=*/true, CE->getSourceRange(),
5472+
CE->getOperatorLoc());
54725473
break;
54735474
default:
54745475
break;
@@ -5478,7 +5479,7 @@ bool OpenMPIterationSpaceChecker::checkAndSetCond(Expr *S) {
54785479
if (dependent() || SemaRef.CurContext->isDependentContext())
54795480
return false;
54805481
SemaRef.Diag(CondLoc, diag::err_omp_loop_not_canonical_cond)
5481-
<< S->getSourceRange() << LCDecl;
5482+
<< (IneqCondIsCanonical ? 1 : 0) << S->getSourceRange() << LCDecl;
54825483
return true;
54835484
}
54845485

clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
1+
// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-target -Wuninitialized
2+
// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-target -Wuninitialized
23

3-
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
4+
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-target -Wuninitialized
5+
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-target -Wuninitialized
46

57
class S {
68
int a;
@@ -124,36 +126,36 @@ int test_iteration_spaces() {
124126

125127
#pragma omp target
126128
#pragma omp teams
127-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
129+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
128130
#pragma omp distribute parallel for simd
129131
for (int i = 0; i; i++)
130132
c[i] = a[i];
131133

132134
#pragma omp target
133135
#pragma omp teams
134-
// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
136+
// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
135137
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
136138
#pragma omp distribute parallel for simd
137139
for (int i = 0; jj < kk; ii++)
138140
c[i] = a[i];
139141

140142
#pragma omp target
141143
#pragma omp teams
142-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
144+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
143145
#pragma omp distribute parallel for simd
144146
for (int i = 0; !!i; i++)
145147
c[i] = a[i];
146148

147-
// Ok
148149
#pragma omp target
149150
#pragma omp teams
151+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
150152
#pragma omp distribute parallel for simd
151153
for (int i = 0; i != 1; i++)
152154
c[i] = a[i];
153155

154156
#pragma omp target
155157
#pragma omp teams
156-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
158+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
157159
#pragma omp distribute parallel for simd
158160
for (int i = 0;; i++)
159161
c[i] = a[i];
@@ -339,16 +341,16 @@ int test_iteration_spaces() {
339341

340342
#pragma omp target
341343
#pragma omp teams
342-
// expected-note@+2 {{defined as private}}
343-
// expected-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be private, predetermined as linear}}
344+
// omp4-note@+2 {{defined as private}}
345+
// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be private, predetermined as linear}}
344346
#pragma omp distribute parallel for simd private(ii)
345347
for (ii = 0; ii < 10; ii++)
346348
c[ii] = a[ii];
347349

348350
#pragma omp target
349351
#pragma omp teams
350-
// expected-note@+2 {{defined as lastprivate}}
351-
// expected-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
352+
// omp4-note@+2 {{defined as lastprivate}}
353+
// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
352354
#pragma omp distribute parallel for simd lastprivate(ii)
353355
for (ii = 0; ii < 10; ii++)
354356
c[ii] = a[ii];
@@ -543,19 +545,19 @@ int test_with_random_access_iterator() {
543545
++begin;
544546
#pragma omp target
545547
#pragma omp teams
546-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
548+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
547549
#pragma omp distribute parallel for simd
548550
for (GoodIter I = begin; I - I; ++I)
549551
++I;
550552
#pragma omp target
551553
#pragma omp teams
552-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
554+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
553555
#pragma omp distribute parallel for simd
554556
for (GoodIter I = begin; begin < end; ++I)
555557
++I;
556558
#pragma omp target
557559
#pragma omp teams
558-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
560+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
559561
#pragma omp distribute parallel for simd
560562
for (GoodIter I = begin; !I; ++I)
561563
++I;

clang/test/OpenMP/distribute_simd_loop_messages.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
1+
// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
2+
// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
23

3-
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
4+
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
5+
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
46

57
static int sii;
68
// expected-note@+1 {{defined as threadprivate or thread local}}
@@ -115,36 +117,36 @@ int test_iteration_spaces() {
115117

116118
#pragma omp target
117119
#pragma omp teams
118-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
120+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
119121
#pragma omp distribute simd
120122
for (int i = 0; i; i++)
121123
c[i] = a[i];
122124

123125
#pragma omp target
124126
#pragma omp teams
125-
// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
127+
// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
126128
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
127129
#pragma omp distribute simd
128130
for (int i = 0; jj < kk; ii++)
129131
c[i] = a[i];
130132

131133
#pragma omp target
132134
#pragma omp teams
133-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
135+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
134136
#pragma omp distribute simd
135137
for (int i = 0; !!i; i++)
136138
c[i] = a[i];
137139

138-
// Ok
139140
#pragma omp target
140141
#pragma omp teams
142+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
141143
#pragma omp distribute simd
142144
for (int i = 0; i != 1; i++)
143145
c[i] = a[i];
144146

145147
#pragma omp target
146148
#pragma omp teams
147-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
149+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
148150
#pragma omp distribute simd
149151
for (int i = 0; ; i++)
150152
c[i] = a[i];
@@ -316,8 +318,8 @@ int test_iteration_spaces() {
316318

317319
#pragma omp target
318320
#pragma omp teams
319-
// expected-note@+2 {{defined as private}}
320-
// expected-error@+2 {{loop iteration variable in the associated loop of 'omp distribute simd' directive may not be private, predetermined as linear}}
321+
// omp4-note@+2 {{defined as private}}
322+
// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp distribute simd' directive may not be private, predetermined as linear}}
321323
#pragma omp distribute simd private(ii)
322324
for (ii = 0; ii < 10; ii++)
323325
c[ii] = a[ii];
@@ -532,19 +534,19 @@ int test_with_random_access_iterator() {
532534
++begin;
533535
#pragma omp target
534536
#pragma omp teams
535-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
537+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
536538
#pragma omp distribute simd
537539
for (GoodIter I = begin; I - I; ++I)
538540
++I;
539541
#pragma omp target
540542
#pragma omp teams
541-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
543+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
542544
#pragma omp distribute simd
543545
for (GoodIter I = begin; begin < end; ++I)
544546
++I;
545547
#pragma omp target
546548
#pragma omp teams
547-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
549+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
548550
#pragma omp distribute simd
549551
for (GoodIter I = begin; !I; ++I)
550552
++I;

clang/test/OpenMP/for_loop_messages.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
1+
// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
2+
// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
23

3-
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
4+
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
5+
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
46

57
class S {
68
int a;
@@ -113,32 +115,32 @@ int test_iteration_spaces() {
113115
c[ii] = a[ii];
114116

115117
#pragma omp parallel
116-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
118+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
117119
#pragma omp for
118120
for (int i = 0; i; i++)
119121
c[i] = a[i];
120122

121123
#pragma omp parallel
122-
// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
124+
// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
123125
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
124126
#pragma omp for
125127
for (int i = 0; jj < kk; ii++)
126128
c[i] = a[i];
127129

128130
#pragma omp parallel
129-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
131+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
130132
#pragma omp for
131133
for (int i = 0; !!i; i++)
132134
c[i] = a[i];
133135

134-
// Ok
135136
#pragma omp parallel
137+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
136138
#pragma omp for
137139
for (int i = 0; i != 1; i++)
138140
c[i] = a[i];
139141

140142
#pragma omp parallel
141-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
143+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
142144
#pragma omp for
143145
for (int i = 0;; i++)
144146
c[i] = a[i];
@@ -533,17 +535,17 @@ int test_with_random_access_iterator() {
533535
for (begin = end; begin < end; ++begin)
534536
++begin;
535537
#pragma omp parallel
536-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
538+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
537539
#pragma omp for
538540
for (GoodIter I = begin; I - I; ++I)
539541
++I;
540542
#pragma omp parallel
541-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
543+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
542544
#pragma omp for
543545
for (GoodIter I = begin; begin < end; ++I)
544546
++I;
545547
#pragma omp parallel
546-
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
548+
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
547549
#pragma omp for
548550
for (GoodIter I = begin; !I; ++I)
549551
++I;

0 commit comments

Comments
 (0)