Explain why the array bound is non-constant in VLA diagnostics.

In passing, also use a more precise diagnostic to explain why an
expression is not an ICE if it's not of integral type.
This commit is contained in:
Richard Smith 2020-08-19 12:46:22 -07:00
parent 09ca3f41bb
commit 6f33936719
121 changed files with 654 additions and 598 deletions

View File

@ -733,8 +733,8 @@ def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">;
def VariadicMacros : DiagGroup<"variadic-macros">;
def VectorConversion : DiagGroup<"vector-conversion">; // clang specific
def VexingParse : DiagGroup<"vexing-parse">;
def VLA : DiagGroup<"vla">;
def VLAExtension : DiagGroup<"vla-extension">;
def VLA : DiagGroup<"vla", [VLAExtension]>;
def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
def Visibility : DiagGroup<"visibility">;
def ZeroLengthArray : DiagGroup<"zero-length-array">;

View File

@ -91,8 +91,8 @@ def ext_cce_narrowing : ExtWarn<
"evaluates to %2, which cannot be narrowed to type %3}1">,
InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
def err_ice_not_integral : Error<
"integral constant expression must have integral or unscoped enumeration "
"type, not %0">;
"%select{integer|integral}1 constant expression must have "
"%select{integer|integral or unscoped enumeration}1 type, not %0">;
def err_ice_incomplete_type : Error<
"integral constant expression has incomplete class type %0">;
def err_ice_explicit_conversion : Error<

View File

@ -11588,9 +11588,12 @@ public:
VerifyICEDiagnoser(bool Suppress = false) : Suppress(Suppress) { }
virtual void diagnoseNotICE(Sema &S, SourceLocation Loc, SourceRange SR) =0;
virtual void diagnoseFold(Sema &S, SourceLocation Loc, SourceRange SR);
virtual ~VerifyICEDiagnoser() { }
virtual SemaDiagnosticBuilder
diagnoseNotICEType(Sema &S, SourceLocation Loc, QualType T);
virtual SemaDiagnosticBuilder diagnoseNotICE(Sema &S,
SourceLocation Loc) = 0;
virtual SemaDiagnosticBuilder diagnoseFold(Sema &S, SourceLocation Loc);
virtual ~VerifyICEDiagnoser() {}
};
/// VerifyIntegerConstantExpression - Verifies that an expression is an ICE,

View File

@ -1066,8 +1066,9 @@ static IsTupleLike isTupleLike(Sema &S, SourceLocation Loc, QualType T,
TemplateArgumentListInfo &Args;
ICEDiagnoser(LookupResult &R, TemplateArgumentListInfo &Args)
: R(R), Args(Args) {}
void diagnoseNotICE(Sema &S, SourceLocation Loc, SourceRange SR) override {
S.Diag(Loc, diag::err_decomp_decl_std_tuple_size_not_constant)
Sema::SemaDiagnosticBuilder diagnoseNotICE(Sema &S,
SourceLocation Loc) override {
return S.Diag(Loc, diag::err_decomp_decl_std_tuple_size_not_constant)
<< printTemplateArgs(S.Context.getPrintingPolicy(), Args);
}
} Diagnoser(R, Args);

View File

@ -15821,8 +15821,13 @@ ExprResult Sema::VerifyIntegerConstantExpression(Expr *E,
llvm::APSInt *Result) {
class SimpleICEDiagnoser : public VerifyICEDiagnoser {
public:
void diagnoseNotICE(Sema &S, SourceLocation Loc, SourceRange SR) override {
S.Diag(Loc, diag::err_expr_not_ice) << S.LangOpts.CPlusPlus << SR;
SemaDiagnosticBuilder diagnoseNotICEType(Sema &S, SourceLocation Loc,
QualType T) override {
return S.Diag(Loc, diag::err_ice_not_integral)
<< T << S.LangOpts.CPlusPlus;
}
SemaDiagnosticBuilder diagnoseNotICE(Sema &S, SourceLocation Loc) override {
return S.Diag(Loc, diag::err_expr_not_ice) << S.LangOpts.CPlusPlus;
}
} Diagnoser;
@ -15840,17 +15845,23 @@ ExprResult Sema::VerifyIntegerConstantExpression(Expr *E,
IDDiagnoser(unsigned DiagID)
: VerifyICEDiagnoser(DiagID == 0), DiagID(DiagID) { }
void diagnoseNotICE(Sema &S, SourceLocation Loc, SourceRange SR) override {
S.Diag(Loc, DiagID) << SR;
SemaDiagnosticBuilder diagnoseNotICE(Sema &S, SourceLocation Loc) override {
return S.Diag(Loc, DiagID);
}
} Diagnoser(DiagID);
return VerifyIntegerConstantExpression(E, Result, Diagnoser, AllowFold);
}
void Sema::VerifyICEDiagnoser::diagnoseFold(Sema &S, SourceLocation Loc,
SourceRange SR) {
S.Diag(Loc, diag::ext_expr_not_ice) << SR << S.LangOpts.CPlusPlus;
Sema::SemaDiagnosticBuilder
Sema::VerifyICEDiagnoser::diagnoseNotICEType(Sema &S, SourceLocation Loc,
QualType T) {
return diagnoseNotICE(S, Loc);
}
Sema::SemaDiagnosticBuilder
Sema::VerifyICEDiagnoser::diagnoseFold(Sema &S, SourceLocation Loc) {
return S.Diag(Loc, diag::ext_expr_not_ice) << S.LangOpts.CPlusPlus;
}
ExprResult
@ -15867,14 +15878,16 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
// unscoped enumeration type
ExprResult Converted;
class CXX11ConvertDiagnoser : public ICEConvertDiagnoser {
VerifyICEDiagnoser &BaseDiagnoser;
public:
CXX11ConvertDiagnoser(bool Silent)
: ICEConvertDiagnoser(/*AllowScopedEnumerations*/false,
Silent, true) {}
CXX11ConvertDiagnoser(VerifyICEDiagnoser &BaseDiagnoser)
: ICEConvertDiagnoser(/*AllowScopedEnumerations*/ false,
BaseDiagnoser.Suppress, true),
BaseDiagnoser(BaseDiagnoser) {}
SemaDiagnosticBuilder diagnoseNotInt(Sema &S, SourceLocation Loc,
QualType T) override {
return S.Diag(Loc, diag::err_ice_not_integral) << T;
return BaseDiagnoser.diagnoseNotICEType(S, Loc, T);
}
SemaDiagnosticBuilder diagnoseIncomplete(
@ -15908,7 +15921,7 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
Sema &S, SourceLocation Loc, QualType T, QualType ConvTy) override {
llvm_unreachable("conversion functions are permitted");
}
} ConvertDiagnoser(Diagnoser.Suppress);
} ConvertDiagnoser(Diagnoser);
Converted = PerformContextualImplicitConversion(DiagLoc, E,
ConvertDiagnoser);
@ -15920,7 +15933,8 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
} else if (!E->getType()->isIntegralOrUnscopedEnumerationType()) {
// An ICE must be of integral or unscoped enumeration type.
if (!Diagnoser.Suppress)
Diagnoser.diagnoseNotICE(*this, DiagLoc, E->getSourceRange());
Diagnoser.diagnoseNotICEType(*this, DiagLoc, E->getType())
<< E->getSourceRange();
return ExprError();
}
@ -15973,7 +15987,7 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
if (!Folded || !AllowFold) {
if (!Diagnoser.Suppress) {
Diagnoser.diagnoseNotICE(*this, DiagLoc, E->getSourceRange());
Diagnoser.diagnoseNotICE(*this, DiagLoc) << E->getSourceRange();
for (const PartialDiagnosticAt &Note : Notes)
Diag(Note.first, Note.second);
}
@ -15981,7 +15995,7 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
return ExprError();
}
Diagnoser.diagnoseFold(*this, DiagLoc, E->getSourceRange());
Diagnoser.diagnoseFold(*this, DiagLoc) << E->getSourceRange();
for (const PartialDiagnosticAt &Note : Notes)
Diag(Note.first, Note.second);

View File

@ -6983,9 +6983,9 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
public:
TmplArgICEDiagnoser(QualType T) : T(T) { }
void diagnoseNotICE(Sema &S, SourceLocation Loc,
SourceRange SR) override {
S.Diag(Loc, diag::err_template_arg_not_ice) << T << SR;
SemaDiagnosticBuilder diagnoseNotICE(Sema &S,
SourceLocation Loc) override {
return S.Diag(Loc, diag::err_template_arg_not_ice) << T;
}
} Diagnoser(ArgType);

View File

@ -2221,26 +2221,48 @@ QualType Sema::BuildExtIntType(bool IsUnsigned, Expr *BitWidth,
return Context.getExtIntType(IsUnsigned, NumBits);
}
/// Check whether the specified array size makes the array type a VLA. If so,
/// return true, if not, return the size of the array in SizeVal.
static bool isArraySizeVLA(Sema &S, Expr *ArraySize, llvm::APSInt &SizeVal) {
/// Check whether the specified array bound can be evaluated using the relevant
/// language rules. If so, returns the possibly-converted expression and sets
/// SizeVal to the size. If not, but the expression might be a VLA bound,
/// returns ExprResult(). Otherwise, produces a diagnostic and returns
/// ExprError().
static ExprResult checkArraySize(Sema &S, Expr *&ArraySize,
llvm::APSInt &SizeVal, unsigned VLADiag,
bool VLAIsError) {
// If the size is an ICE, it certainly isn't a VLA. If we're in a GNU mode
// (like gnu99, but not c99) accept any evaluatable value as an extension.
class VLADiagnoser : public Sema::VerifyICEDiagnoser {
public:
VLADiagnoser() : Sema::VerifyICEDiagnoser(true) {}
unsigned VLADiag;
bool VLAIsError;
bool IsVLA = false;
void diagnoseNotICE(Sema &S, SourceLocation Loc, SourceRange SR) override {
VLADiagnoser(unsigned VLADiag, bool VLAIsError)
: VLADiag(VLADiag), VLAIsError(VLAIsError) {}
Sema::SemaDiagnosticBuilder diagnoseNotICEType(Sema &S, SourceLocation Loc,
QualType T) override {
return S.Diag(Loc, diag::err_array_size_non_int) << T;
}
void diagnoseFold(Sema &S, SourceLocation Loc, SourceRange SR) override {
S.Diag(Loc, diag::ext_vla_folded_to_constant) << SR;
Sema::SemaDiagnosticBuilder diagnoseNotICE(Sema &S,
SourceLocation Loc) override {
IsVLA = !VLAIsError;
return S.Diag(Loc, VLADiag);
}
} Diagnoser;
return S.VerifyIntegerConstantExpression(ArraySize, &SizeVal, Diagnoser,
S.LangOpts.GNUMode ||
S.LangOpts.OpenCL).isInvalid();
Sema::SemaDiagnosticBuilder diagnoseFold(Sema &S,
SourceLocation Loc) override {
return S.Diag(Loc, diag::ext_vla_folded_to_constant);
}
} Diagnoser(VLADiag, VLAIsError);
ExprResult R = S.VerifyIntegerConstantExpression(
ArraySize, &SizeVal, Diagnoser,
(S.LangOpts.GNUMode || S.LangOpts.OpenCL));
if (Diagnoser.IsVLA)
return ExprResult();
return R;
}
/// Build an array type.
@ -2352,68 +2374,95 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM,
return QualType();
}
// VLAs always produce at least a -Wvla diagnostic, sometimes an error.
unsigned VLADiag;
bool VLAIsError;
if (getLangOpts().OpenCL) {
// OpenCL v1.2 s6.9.d: variable length arrays are not supported.
VLADiag = diag::err_opencl_vla;
VLAIsError = true;
} else if (getLangOpts().C99) {
VLADiag = diag::warn_vla_used;
VLAIsError = false;
} else if (isSFINAEContext()) {
VLADiag = diag::err_vla_in_sfinae;
VLAIsError = true;
} else {
VLADiag = diag::ext_vla;
VLAIsError = false;
}
llvm::APSInt ConstVal(Context.getTypeSize(Context.getSizeType()));
if (!ArraySize) {
if (ASM == ArrayType::Star)
if (ASM == ArrayType::Star) {
Diag(Loc, VLADiag);
if (VLAIsError)
return QualType();
T = Context.getVariableArrayType(T, nullptr, ASM, Quals, Brackets);
else
} else {
T = Context.getIncompleteArrayType(T, ASM, Quals);
}
} else if (ArraySize->isTypeDependent() || ArraySize->isValueDependent()) {
T = Context.getDependentSizedArrayType(T, ArraySize, ASM, Quals, Brackets);
} else if ((!T->isDependentType() && !T->isIncompleteType() &&
!T->isConstantSizeType()) ||
isArraySizeVLA(*this, ArraySize, ConstVal)) {
// Even in C++11, don't allow contextual conversions in the array bound
// of a VLA.
if (getLangOpts().CPlusPlus11 &&
!ArraySize->getType()->isIntegralOrUnscopedEnumerationType()) {
Diag(ArraySize->getBeginLoc(), diag::err_array_size_non_int)
<< ArraySize->getType() << ArraySize->getSourceRange();
return QualType();
}
// C99: an array with an element type that has a non-constant-size is a VLA.
// C99: an array with a non-ICE size is a VLA. We accept any expression
// that we can fold to a non-zero positive value as an extension.
T = Context.getVariableArrayType(T, ArraySize, ASM, Quals, Brackets);
} else {
// C99 6.7.5.2p1: If the expression is a constant expression, it shall
// have a value greater than zero.
if (ConstVal.isSigned() && ConstVal.isNegative()) {
if (Entity)
Diag(ArraySize->getBeginLoc(), diag::err_decl_negative_array_size)
<< getPrintableNameForEntity(Entity) << ArraySize->getSourceRange();
else
Diag(ArraySize->getBeginLoc(), diag::err_typecheck_negative_array_size)
<< ArraySize->getSourceRange();
ExprResult R =
checkArraySize(*this, ArraySize, ConstVal, VLADiag, VLAIsError);
if (R.isInvalid())
return QualType();
}
if (ConstVal == 0) {
// GCC accepts zero sized static arrays. We allow them when
// we're not in a SFINAE context.
Diag(ArraySize->getBeginLoc(), isSFINAEContext()
? diag::err_typecheck_zero_array_size
: diag::ext_typecheck_zero_array_size)
<< ArraySize->getSourceRange();
} else if (!T->isDependentType() && !T->isVariablyModifiedType() &&
!T->isIncompleteType() && !T->isUndeducedType()) {
if (!R.isUsable()) {
// C99: an array with a non-ICE size is a VLA. We accept any expression
// that we can fold to a non-zero positive value as a non-VLA as an
// extension.
T = Context.getVariableArrayType(T, ArraySize, ASM, Quals, Brackets);
} else if (!T->isDependentType() && !T->isIncompleteType() &&
!T->isConstantSizeType()) {
// C99: an array with an element type that has a non-constant-size is a
// VLA.
// FIXME: Add a note to explain why this isn't a VLA.
Diag(Loc, VLADiag);
if (VLAIsError)
return QualType();
T = Context.getVariableArrayType(T, ArraySize, ASM, Quals, Brackets);
} else {
// C99 6.7.5.2p1: If the expression is a constant expression, it shall
// have a value greater than zero.
// In C++, this follows from narrowing conversions being disallowed.
if (ConstVal.isSigned() && ConstVal.isNegative()) {
if (Entity)
Diag(ArraySize->getBeginLoc(), diag::err_decl_negative_array_size)
<< getPrintableNameForEntity(Entity)
<< ArraySize->getSourceRange();
else
Diag(ArraySize->getBeginLoc(),
diag::err_typecheck_negative_array_size)
<< ArraySize->getSourceRange();
return QualType();
}
if (ConstVal == 0) {
// GCC accepts zero sized static arrays. We allow them when
// we're not in a SFINAE context.
Diag(ArraySize->getBeginLoc(),
isSFINAEContext() ? diag::err_typecheck_zero_array_size
: diag::ext_typecheck_zero_array_size)
<< ArraySize->getSourceRange();
}
// Is the array too large?
unsigned ActiveSizeBits
= ConstantArrayType::getNumAddressingBits(Context, T, ConstVal);
unsigned ActiveSizeBits =
(!T->isDependentType() && !T->isVariablyModifiedType() &&
!T->isIncompleteType() && !T->isUndeducedType())
? ConstantArrayType::getNumAddressingBits(Context, T, ConstVal)
: ConstVal.getActiveBits();
if (ActiveSizeBits > ConstantArrayType::getMaxSizeBits(Context)) {
Diag(ArraySize->getBeginLoc(), diag::err_array_too_large)
<< ConstVal.toString(10) << ArraySize->getSourceRange();
return QualType();
}
T = Context.getConstantArrayType(T, ConstVal, ArraySize, ASM, Quals);
}
T = Context.getConstantArrayType(T, ConstVal, ArraySize, ASM, Quals);
}
// OpenCL v1.2 s6.9.d: variable length arrays are not supported.
if (getLangOpts().OpenCL && T->isVariableArrayType()) {
Diag(Loc, diag::err_opencl_vla);
return QualType();
}
if (T->isVariableArrayType() && !Context.getTargetInfo().isVLASupported()) {
@ -2426,26 +2475,12 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM,
: CFT_InvalidTarget);
}
// If this is not C99, extwarn about VLA's and C99 array size modifiers.
if (!getLangOpts().C99) {
if (T->isVariableArrayType()) {
// Prohibit the use of VLAs during template argument deduction.
if (isSFINAEContext()) {
Diag(Loc, diag::err_vla_in_sfinae);
return QualType();
}
// Just extwarn about VLAs.
else
Diag(Loc, diag::ext_vla);
} else if (ASM != ArrayType::Normal || Quals != 0)
Diag(Loc,
getLangOpts().CPlusPlus? diag::err_c99_array_usage_cxx
: diag::ext_c99_array_usage) << ASM;
}
if (T->isVariableArrayType()) {
// Warn about VLAs for -Wvla.
Diag(Loc, diag::warn_vla_used);
// If this is not C99, diagnose array size modifiers on non-VLAs.
if (!getLangOpts().C99 && !T->isVariableArrayType() &&
(ASM != ArrayType::Normal || Quals != 0)) {
Diag(Loc, getLangOpts().CPlusPlus ? diag::err_c99_array_usage_cxx
: diag::ext_c99_array_usage)
<< ASM;
}
// OpenCL v2.0 s6.12.5 - Arrays of blocks are not supported.

View File

@ -915,7 +915,7 @@ namespace dr75 { // dr75: yes
namespace dr76 { // dr76: yes
const volatile int n = 1;
int arr[n]; // expected-error +{{variable length array}}
int arr[n]; // expected-error +{{variable length array}} expected-note {{read of volatile}}
}
namespace dr77 { // dr77: yes

View File

@ -895,7 +895,7 @@ namespace dr367 { // dr367: yes
// array as being a VLA!
int a[true ? throw 0 : 4]; // expected-error 2{{variable length array}}
int b[true ? 4 : throw 0];
int c[true ? *new int : 4]; // expected-error 2{{variable length array}}
int c[true ? *new int : 4]; // expected-error 2{{variable length array}} expected-note {{read of uninitialized}}
int d[true ? 4 : *new int];
#if __cplusplus < 201103L
// expected-error@-4 {{variable length array}} expected-error@-4 {{constant expression}}

View File

@ -644,8 +644,8 @@ namespace dr450 { // dr450: yes
namespace dr451 { // dr451: yes
const int a = 1 / 0; // expected-warning {{undefined}}
const int b = 1 / 0; // expected-warning {{undefined}}
int arr[b]; // expected-error +{{variable length arr}}
const int b = 1 / 0; // expected-warning {{undefined}} expected-note {{here}} expected-note 0-1{{division by zero}}
int arr[b]; // expected-error +{{variable length arr}} expected-note {{initializer of 'b' is not a constant}}
}
namespace dr452 { // dr452: yes
@ -682,7 +682,7 @@ namespace dr457 { // dr457: yes
const int a = 1;
const volatile int b = 1;
int ax[a];
int bx[b]; // expected-error +{{variable length array}}
int bx[b]; // expected-error +{{variable length array}} expected-note {{read of volatile}}
enum E {
ea = a,
@ -1088,8 +1088,8 @@ namespace dr486 { // dr486: yes
namespace dr487 { // dr487: yes
enum E { e };
int operator+(int, E);
int i[4 + e]; // expected-error 2{{variable length array}}
int operator+(int, E); // expected-note 0-1{{here}}
int i[4 + e]; // expected-error 2{{variable length array}} expected-note 0-1{{non-constexpr}}
}
namespace dr488 { // dr488: yes c++11

View File

@ -12,8 +12,8 @@ struct This {
int this1 : this1; // expected-error {{undeclared}}
int this2 : this->this1; // expected-error {{invalid}}
void this3() {
int n1[this->this1]; // expected-warning {{variable length array}}
int n2[this1]; // expected-warning {{variable length array}}
int n1[this->this1]; // expected-warning {{variable length array}} expected-note {{'this'}}
int n2[this1]; // expected-warning {{variable length array}} expected-note {{'this'}}
(void)n1, (void)n2;
}
};

View File

@ -7,15 +7,15 @@ namespace std_example {
struct A {
constexpr A(int i) : val(i) { }
constexpr operator int() const { return val; }
constexpr operator long() const { return 43; }
constexpr operator int() const { return val; } // expected-note {{here}}
constexpr operator long() const { return 43; } // expected-note {{here}}
private:
int val;
};
template<int> struct X { };
constexpr A a = 42;
X<a> x; // ok, unique conversion to int
int ary[a]; // expected-error {{size of array has non-integer type 'const std_example::A'}}
int ary[a]; // expected-error {{ambiguous conversion from type 'const std_example::A' to an integral or unscoped enumeration type}}
}
@ -23,15 +23,15 @@ struct OK {
constexpr OK() {}
constexpr operator int() const { return 8; }
} constexpr ok;
extern struct Incomplete incomplete; // expected-note 4{{forward decl}}
extern struct Incomplete incomplete; // expected-note 5{{forward decl}}
struct Explicit {
constexpr Explicit() {}
constexpr explicit operator int() const { return 4; } // expected-note 4{{here}}
constexpr explicit operator int() const { return 4; } // expected-note 5{{here}}
} constexpr expl;
struct Ambiguous {
constexpr Ambiguous() {}
constexpr operator int() const { return 2; } // expected-note 4{{here}}
constexpr operator long() const { return 1; } // expected-note 4{{here}}
constexpr operator int() const { return 2; } // expected-note 5{{here}}
constexpr operator long() const { return 1; } // expected-note 5{{here}}
} constexpr ambig;
constexpr int test_ok = ok; // ok
@ -68,12 +68,10 @@ alignas(ambig) int alignas4; // expected-error {{ambiguous conversion}}
// [dcl.array]p1: If the constant-expression is present, it shall be an integral
// constant expression
// FIXME: The VLA recovery results in us giving diagnostics which aren't great
// here.
int array1[ok];
int array2[incomplete]; // expected-error {{non-integer type}}
int array3[expl]; // expected-error {{non-integer type}}
int array4[ambig]; // expected-error {{non-integer type}}
int array2[incomplete]; // expected-error {{incomplete}}
int array3[expl]; // expected-error {{explicit conversion}}
int array4[ambig]; // expected-error {{ambiguous conversion}}
// [class.bit]p1: The constasnt-expression shall be an integral constant
// expression

View File

@ -387,9 +387,9 @@ void hint() {
a += 1;
#pragma omp atomic hint(+ // omp45-error {{unexpected OpenMP clause 'hint' in directive '#pragma omp atomic'}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
a += 1;
#pragma omp atomic hint(a // omp45-error {{unexpected OpenMP clause 'hint' in directive '#pragma omp atomic'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expression is not an integer constant expression}}
#pragma omp atomic hint(a // omp45-error {{unexpected OpenMP clause 'hint' in directive '#pragma omp atomic'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{integer constant expression}}
a += 1;
#pragma omp atomic hint(a) // omp45-error {{unexpected OpenMP clause 'hint' in directive '#pragma omp atomic'}} omp50-error {{expression is not an integer constant expression}}
#pragma omp atomic hint(a) // omp45-error {{unexpected OpenMP clause 'hint' in directive '#pragma omp atomic'}} omp50-error {{integer constant expression}}
a += 1;
#pragma omp atomic hint(1) hint(1) // omp45-error 2 {{unexpected OpenMP clause 'hint' in directive '#pragma omp atomic'}} expected-error {{directive '#pragma omp atomic' cannot contain more than one 'hint' clause}}
a += 1;

View File

@ -65,7 +65,7 @@ int tmain(int argc, char **argv) { // expected-note {{declared here}}
foo();
#pragma omp critical (name2) hint(+ // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp critical (name2) hint(argc) // expected-error {{expression is not an integral constant expression}} expected-note {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp critical (name2) hint(argc) // expected-error {{integral constant expression}} expected-note {{read of non-const variable 'argc' is not allowed in a constant expression}}
foo();
#pragma omp critical (name) hint(N) // expected-error {{argument to 'hint' clause must be a strictly positive integer value}} expected-error {{constructs with the same name must have a 'hint' clause with the same value}} expected-note {{'hint' clause with value '4'}}
foo();
@ -128,7 +128,7 @@ int main(int argc, char **argv) { // expected-note {{declared here}}
foo();
#pragma omp critical (name2) hint(+ // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp critical (name2) hint(argc) // expected-error {{expression is not an integral constant expression}} expected-note {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp critical (name2) hint(argc) // expected-error {{integral constant expression}} expected-note {{read of non-const variable 'argc' is not allowed in a constant expression}}
foo();
#pragma omp critical (name) hint(23) // expected-note {{previous 'hint' clause with value '23'}}
foo();

View File

@ -56,7 +56,7 @@ void h(int *hp, int *hp2, int *hq, int *lin) {
#pragma omp declare simd inbranch inbranch notinbranch // expected-error {{unexpected 'notinbranch' clause, 'inbranch' is specified already}}
#pragma omp declare simd notinbranch notinbranch inbranch // expected-error {{unexpected 'inbranch' clause, 'notinbranch' is specified already}}
// expected-note@+2 {{read of non-const variable 'b' is not allowed in a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp declare simd simdlen(b)
// expected-error@+1 {{directive '#pragma omp declare simd' cannot contain more than one 'simdlen' clause}}
#pragma omp declare simd simdlen(32) simdlen(c)

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp distribute collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp distribute collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -43,13 +43,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+3 2 {{directive '#pragma omp distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp distribute collapse (foobool(argc)), collapse (true), collapse (-5)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp distribute collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -78,12 +78,12 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp distribute collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp distribute collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus >= 201103L
// expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
// expected-error@+2 2 {{directive '#pragma omp distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp distribute collapse (foobool(argc)), collapse (true), collapse (-5)
@ -91,7 +91,7 @@ int main(int argc, char **argv) {
#pragma omp distribute collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -35,7 +35,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target
#pragma omp teams
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp distribute parallel for collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -54,7 +54,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp distribute parallel for', but found only 1}}
// expected-error@+8 2 {{directive '#pragma omp distribute parallel for' cannot contain more than one 'collapse' clause}}
// expected-error@+7 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+6 2 {{expression is not an integral constant expression}}
// expected-error@+6 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -67,7 +67,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp distribute parallel for collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+6 2 {{expression is not an integral constant expression}}
// expected-error@+6 2 {{integral constant expression}}
#else
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -111,7 +111,7 @@ int main(int argc, char **argv) {
#pragma omp teams
#pragma omp distribute parallel for collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp distribute parallel for', but found only 1}}
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -119,7 +119,7 @@ int main(int argc, char **argv) {
#pragma omp teams
#pragma omp distribute parallel for collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+8 {{expression is not an integral constant expression}}
// expected-error@+8 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+6{{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -134,7 +134,7 @@ int main(int argc, char **argv) {
#pragma omp distribute parallel for collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#else
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -221,7 +221,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd aligned(f:j) // expected-note {{initializer of 'j' is not a constant expression}} expected-error {{expression is not an integral constant expression}}
#pragma omp distribute parallel for simd aligned(f:j) // expected-note {{initializer of 'j' is not a constant expression}} expected-error {{integral constant expression}}
for (I k = 0; k < argc; ++k) { ++k; v += j; }

View File

@ -35,7 +35,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target
#pragma omp teams
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp distribute parallel for simd collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -54,7 +54,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp distribute parallel for simd', but found only 1}}
// expected-error@+8 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'collapse' clause}}
// expected-error@+7 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+6 2 {{expression is not an integral constant expression}}
// expected-error@+6 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -67,7 +67,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp distribute parallel for simd collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+6 2 {{expression is not an integral constant expression}}
// expected-error@+6 2 {{integral constant expression}}
#else
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -111,7 +111,7 @@ int main(int argc, char **argv) {
#pragma omp teams
#pragma omp distribute parallel for simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp distribute parallel for simd', but found only 1}}
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -119,7 +119,7 @@ int main(int argc, char **argv) {
#pragma omp teams
#pragma omp distribute parallel for simd collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+8 {{expression is not an integral constant expression}}
// expected-error@+8 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+6{{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -134,7 +134,7 @@ int main(int argc, char **argv) {
#pragma omp distribute parallel for simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#else
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -192,13 +192,13 @@ void test_safelen() {
;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute parallel for simd safelen(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute parallel for simd safelen(foo())
for (i = 0; i < 16; ++i)
;
@ -315,13 +315,13 @@ void test_simdlen() {
;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute parallel for simd simdlen(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute parallel for simd simdlen(foo())
for (i = 0; i < 16; ++i)
;
@ -459,13 +459,13 @@ void test_collapse() {
; // expected-error {{expected 4 for loops after '#pragma omp distribute parallel for simd', but found only 1}}
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute parallel for simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute parallel for simd collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{expression is not an integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
#pragma omp distribute parallel for simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -69,7 +69,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp teams
// expected-error@+3 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -81,7 +81,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+6 2 {{expression is not an integral constant expression}}
// expected-error@+6 2 {{integral constant expression}}
#else
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -142,7 +142,7 @@ int main(int argc, char **argv) {
#endif
#pragma omp target
#pragma omp teams
#pragma omp parallel for simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp parallel for simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -153,7 +153,7 @@ int main(int argc, char **argv) {
#pragma omp teams
// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -165,7 +165,7 @@ int main(int argc, char **argv) {
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#else
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -38,7 +38,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+5 {{expected ')'}} expected-note@+5 {{to match this '('}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
// expected-note@+3 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target
#pragma omp teams
@ -72,7 +72,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp teams
// expected-error@+3 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}}
// expected-error@+2 {{argument to 'simdlen' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -84,7 +84,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+6 2 {{expression is not an integral constant expression}}
// expected-error@+6 2 {{integral constant expression}}
#else
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -145,7 +145,7 @@ int main(int argc, char **argv) {
#endif
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp distribute parallel for simd simdlen (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -155,7 +155,7 @@ int main(int argc, char **argv) {
#endif
#pragma omp target
#pragma omp teams
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
// expected-error@+2 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}}
// expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}}
#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5)
@ -169,7 +169,7 @@ int main(int argc, char **argv) {
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#else
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -221,7 +221,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
#pragma omp target
#pragma omp teams
#pragma omp distribute simd aligned(f:j) // expected-note {{initializer of 'j' is not a constant expression}} expected-error {{expression is not an integral constant expression}}
#pragma omp distribute simd aligned(f:j) // expected-note {{initializer of 'j' is not a constant expression}} expected-error {{integral constant expression}}
for (I k = 0; k < argc; ++k) { ++k; v += j; }

View File

@ -35,7 +35,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target
#pragma omp teams
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp distribute simd collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -54,7 +54,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp distribute simd', but found only 1}}
// expected-error@+8 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'collapse' clause}}
// expected-error@+7 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+6 2 {{expression is not an integral constant expression}}
// expected-error@+6 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -67,7 +67,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp distribute simd collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+6 2 {{expression is not an integral constant expression}}
// expected-error@+6 2 {{integral constant expression}}
#else
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -111,7 +111,7 @@ int main(int argc, char **argv) {
#pragma omp teams
#pragma omp distribute simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp distribute simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp distribute simd', but found only 1}}
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -119,7 +119,7 @@ int main(int argc, char **argv) {
#pragma omp teams
#pragma omp distribute simd collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+8 {{expression is not an integral constant expression}}
// expected-error@+8 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+6{{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -134,7 +134,7 @@ int main(int argc, char **argv) {
#pragma omp distribute simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#else
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -194,13 +194,13 @@ void test_safelen() {
;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute simd safelen(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute simd safelen(foo())
for (i = 0; i < 16; ++i)
;
@ -317,13 +317,13 @@ void test_simdlen() {
;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute simd simdlen(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute simd simdlen(foo())
for (i = 0; i < 16; ++i)
;
@ -461,13 +461,13 @@ void test_collapse() {
; // expected-error {{expected 4 for loops after '#pragma omp distribute simd', but found only 1}}
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp distribute simd collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target
#pragma omp teams
#pragma omp distribute simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{expression is not an integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
#pragma omp distribute simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -69,7 +69,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp teams
// expected-error@+3 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'safelen' clause}}
// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp distribute simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -81,7 +81,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+6 2 {{expression is not an integral constant expression}}
// expected-error@+6 2 {{integral constant expression}}
#else
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -142,7 +142,7 @@ int main(int argc, char **argv) {
#endif
#pragma omp target
#pragma omp teams
#pragma omp parallel for simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp parallel for simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -153,7 +153,7 @@ int main(int argc, char **argv) {
#pragma omp teams
// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -165,7 +165,7 @@ int main(int argc, char **argv) {
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#else
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target
#pragma omp teams
#pragma omp distribute simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{expression is not an integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
#pragma omp distribute simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -69,7 +69,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp teams
// expected-error@+3 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'safelen' clause}}
// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp distribute simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -81,7 +81,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+6 2 {{expression is not an integral constant expression}}
// expected-error@+6 2 {{integral constant expression}}
#else
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -142,7 +142,7 @@ int main(int argc, char **argv) {
#endif
#pragma omp target
#pragma omp teams
#pragma omp parallel for simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp parallel for simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -153,7 +153,7 @@ int main(int argc, char **argv) {
#pragma omp teams
// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -165,7 +165,7 @@ int main(int argc, char **argv) {
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#else
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -33,7 +33,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp for collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp for collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -46,7 +46,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp for', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp for' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -55,7 +55,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp for collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -81,13 +81,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp for', but found only 1}}
#pragma omp for collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp for' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp for', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp for collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -98,7 +98,7 @@ int main(int argc, char **argv) {
#pragma omp for collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -190,12 +190,12 @@ void test_collapse() {
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp for', but found only 1}}
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp for collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp for collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -31,7 +31,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i - ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp for ordered(argc
for (int i = ST; i < N; i++)
@ -48,7 +48,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}
argv[0][i] = argv[0][i] - argv[0][i - ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp for', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp for' cannot contain more than one 'ordered' clause}}
// expected-error@+5 {{argument to 'ordered' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -59,7 +59,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i - ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -101,14 +101,14 @@ int main(int argc, char **argv) {
#pragma omp for ordered(2 + 2)) // expected-warning {{extra tokens at the end of '#pragma omp for' are ignored}} expected-note {{as specified in 'ordered' clause}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i - 4]; // expected-error {{expected 4 for loops after '#pragma omp for', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp for ordered(foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i - 4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -121,7 +121,7 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i - 4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -151,7 +151,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
for (I k = 0; k < argc; ++k) ++k;
int v = 0;
// expected-note@+2 {{initializer of 'j' is not a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp for simd aligned(f:j)
for (I k = 0; k < argc; ++k) { ++k; v += j; }
#pragma omp for simd aligned(f)

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp for simd collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp for simd collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp for simd', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp for simd' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp for simd collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -75,13 +75,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp for simd', but found only 1}}
#pragma omp for simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp for simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp for simd', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp for simd collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
#pragma omp for simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -156,11 +156,11 @@ void test_safelen() {
#pragma omp for simd safelen(4, 8)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp for simd safelen(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp for simd safelen(foo())
for (i = 0; i < 16; ++i)
;
@ -241,11 +241,11 @@ void test_simdlen() {
#pragma omp for simd simdlen(4, 8)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp for simd simdlen(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp for simd simdlen(foo())
for (i = 0; i < 16; ++i)
;
@ -357,12 +357,12 @@ void test_collapse() {
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp for simd', but found only 1}}
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp for simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp for simd collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp for simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp for simd safelen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp for simd safelen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp for simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp for simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp for simd safelen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp for simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp for simd simdlen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp for simd simdlen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp for simd' cannot contain more than one 'simdlen' clause}}
// expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp for simd simdlen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp for simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp for simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp for simd simdlen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp for simd simdlen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp master taskloop collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp master taskloop collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp master taskloop', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp master taskloop' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp master taskloop collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -75,13 +75,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
#pragma omp master taskloop collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp master taskloop collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
#pragma omp master taskloop collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -179,12 +179,12 @@ void test_collapse() {
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp master taskloop collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp master taskloop collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -151,7 +151,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
for (I k = 0; k < argc; ++k) ++k;
int v = 0;
// expected-note@+2 {{initializer of 'j' is not a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp master taskloop simd aligned(f:j)
for (I k = 0; k < argc; ++k) { ++k; v += j; }
#pragma omp master taskloop simd aligned(f)

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp master taskloop simd collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp master taskloop simd collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp master taskloop simd', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp master taskloop simd' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp master taskloop simd collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -75,13 +75,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
#pragma omp master taskloop simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp master taskloop simd collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
#pragma omp master taskloop simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -180,12 +180,12 @@ void test_collapse() {
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp master taskloop simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp master taskloop simd collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp master taskloop simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp master taskloop simd safelen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp master taskloop simd' cannot contain more than one 'safelen' clause}}
// expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp master taskloop simd safelen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp master taskloop simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp master taskloop simd safelen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp master taskloop simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp master taskloop simd simdlen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp master taskloop simd simdlen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp master taskloop simd' cannot contain more than one 'simdlen' clause}}
// expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp master taskloop simd simdlen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp master taskloop simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp master taskloop simd simdlen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp master taskloop simd simdlen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -159,7 +159,7 @@ T foo() {
#pragma omp ordered depend(sink : i, j)
#pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}}
#pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}}
#pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{expression is not an integral constant expression}} expected-error {{expected '+' or '-' operation}}
#pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{integral constant expression}} expected-error {{expected '+' or '-' operation}}
#if __cplusplus >= 201103L
// expected-note@-2 {{non-constexpr function 'foo' cannot be used in a constant expression}}
#endif
@ -296,7 +296,7 @@ int k;
#pragma omp ordered depend(sink : i, j) allocate(i) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp ordered'}}
#pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}}
#pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}}
#pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{expression is not an integral constant expression}} expected-error {{expected '+' or '-' operation}}
#pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{integral constant expression}} expected-error {{expected '+' or '-' operation}}
#if __cplusplus >= 201103L
// expected-note@-2 {{non-constexpr function 'foo' cannot be used in a constant expression}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel for collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp parallel for collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel for', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp parallel for' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel for collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -75,13 +75,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel for', but found only 1}}
#pragma omp parallel for collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel for', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp parallel for collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4{{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
#pragma omp parallel for collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -142,11 +142,11 @@ void test_collapse() {
#pragma omp parallel for collapse(4, 8)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp parallel for', but found only 1}}
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel for collapse(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel for collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -30,7 +30,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i - ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp parallel for ordered(argc
for (int i = ST; i < N; i++)
@ -47,7 +47,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}
argv[0][i] = argv[0][i] - argv[0][i - ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel for', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp parallel for' cannot contain more than one 'ordered' clause}}
// expected-error@+5 {{argument to 'ordered' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -58,7 +58,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i - ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -92,14 +92,14 @@ int main(int argc, char **argv) {
#pragma omp parallel for ordered(2 + 2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for' are ignored}} expected-note {{as specified in 'ordered' clause}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i - 4]; // expected-error {{expected 4 for loops after '#pragma omp parallel for', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp parallel for ordered(foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i - 4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -112,7 +112,7 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i - 4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -151,7 +151,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
for (I k = 0; k < argc; ++k) ++k;
int v = 0;
// expected-note@+2 {{initializer of 'j' is not a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp parallel for simd aligned(f:j)
for (I k = 0; k < argc; ++k) { ++k; v += j; }
#pragma omp parallel for simd aligned(f)

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel for simd collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp parallel for simd collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel for simd', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel for simd collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -75,13 +75,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel for simd', but found only 1}}
#pragma omp parallel for simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel for simd', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp parallel for simd collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
#pragma omp parallel for simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -149,11 +149,11 @@ void test_safelen() {
#pragma omp parallel for simd safelen(4, 8)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel for simd safelen(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel for simd safelen(foo())
for (i = 0; i < 16; ++i)
;
@ -234,11 +234,11 @@ void test_simdlen() {
#pragma omp parallel for simd simdlen(4, 8)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel for simd simdlen(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel for simd simdlen(foo())
for (i = 0; i < 16; ++i)
;
@ -350,12 +350,12 @@ void test_collapse() {
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp parallel for simd', but found only 1}}
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel for simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel for simd collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel for simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp parallel for simd safelen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel for simd safelen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp parallel for simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp parallel for simd safelen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp parallel for simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel for simd simdlen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp parallel for simd simdlen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'simdlen' clause}}
// expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel for simd simdlen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp parallel for simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp parallel for simd simdlen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp parallel for simd simdlen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel master taskloop collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp parallel master taskloop collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel master taskloop', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel master taskloop collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -75,13 +75,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
#pragma omp parallel master taskloop collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp parallel master taskloop collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
#pragma omp parallel master taskloop collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -182,12 +182,12 @@ void test_collapse() {
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel master taskloop collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel master taskloop collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -151,7 +151,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
for (I k = 0; k < argc; ++k) ++k;
int v = 0;
// expected-note@+2 {{initializer of 'j' is not a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp parallel master taskloop simd aligned(f:j)
for (I k = 0; k < argc; ++k) { ++k; v += j; }
#pragma omp parallel master taskloop simd aligned(f)

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel master taskloop simd collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp parallel master taskloop simd collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel master taskloop simd collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -75,13 +75,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
#pragma omp parallel master taskloop simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp parallel master taskloop simd collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
#pragma omp parallel master taskloop simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -183,12 +183,12 @@ void test_collapse() {
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel master taskloop simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp parallel master taskloop simd collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel master taskloop simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp parallel master taskloop simd safelen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'safelen' clause}}
// expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel master taskloop simd safelen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp parallel master taskloop simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp parallel master taskloop simd safelen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp parallel master taskloop simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel master taskloop simd simdlen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp parallel master taskloop simd simdlen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'simdlen' clause}}
// expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp parallel master taskloop simd simdlen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp parallel master taskloop simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp parallel master taskloop simd simdlen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp parallel master taskloop simd simdlen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -153,7 +153,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
for (I k = 0; k < argc; ++k) ++k;
int v = 0;
// expected-note@+2 {{initializer of 'j' is not a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp simd aligned(f:j)
for (I k = 0; k < argc; ++k) { ++k; v += j; }
#pragma omp simd aligned(f)

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp simd collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp simd collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp simd', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp simd' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp simd collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -75,13 +75,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp simd', but found only 1}}
#pragma omp simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp simd', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp simd collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
#pragma omp simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -155,11 +155,11 @@ void test_safelen() {
#pragma omp simd safelen(4, 8)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp simd safelen(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp simd safelen(foo())
for (i = 0; i < 16; ++i)
;
@ -240,11 +240,11 @@ void test_simdlen() {
#pragma omp simd simdlen(4, 8)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp simd simdlen(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp simd simdlen(foo())
for (i = 0; i < 16; ++i)
;
@ -341,11 +341,11 @@ void test_collapse() {
#pragma omp simd collapse(4, 8)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp simd', but found only 1}}
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp simd collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp simd safelen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp simd' cannot contain more than one 'safelen' clause}}
// expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp simd safelen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp simd safelen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp simd simdlen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp simd simdlen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp simd' cannot contain more than one 'simdlen' clause}}
// expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp simd simdlen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp simd simdlen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp simd simdlen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target parallel for collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target parallel for collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp target parallel for', but found only 1}}
// expected-error@+3 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'collapse' clause}}
// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target parallel for collapse (foobool(argc)), collapse (true), collapse (-5)
#if __cplusplus >= 201103L
// expected-note@-2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
@ -51,7 +51,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#if __cplusplus >= 201103L
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#else
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
#endif
#pragma omp target parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -75,12 +75,12 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}}
#pragma omp target parallel for collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}}
#pragma omp target parallel for collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target parallel for collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@-2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
// expected-error@+2 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'collapse' clause}}
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target parallel for collapse (foobool(argc)), collapse (true), collapse (-5)
@ -93,7 +93,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#else
// expected-error@+2 {{expression is not an integral constant expression}}
// expected-error@+2 {{integral constant expression}}
#endif
#pragma omp target parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];

View File

@ -142,11 +142,11 @@ void test_collapse() {
#pragma omp target parallel for collapse(4, 8)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}}
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target parallel for collapse(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target parallel for collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -30,7 +30,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i - ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target parallel for ordered(argc
for (int i = ST; i < N; i++)
@ -50,7 +50,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}
#endif
// expected-error@+3 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'ordered' clause}}
// expected-error@+2 {{argument to 'ordered' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target parallel for ordered(foobool(argc)), ordered(true), ordered(-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i - ST];
@ -60,7 +60,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}
#if __cplusplus >= 201103L
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#else
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
#endif
#pragma omp target parallel for ordered(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++)
@ -95,13 +95,13 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target parallel for ordered(foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target parallel for ordered(foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i - 4];
#if __cplusplus >= 201103L
// expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
// expected-error@+2 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'ordered' clause}}
// expected-error@+1 {{argument to 'ordered' clause must be a strictly positive integer value}}
#pragma omp target parallel for ordered(foobool(argc)), ordered(true), ordered(-5)
@ -113,7 +113,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#else
// expected-error@+2 {{expression is not an integral constant expression}}
// expected-error@+2 {{integral constant expression}}
#endif
#pragma omp target parallel for ordered(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++)

View File

@ -151,7 +151,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
for (I k = 0; k < argc; ++k) ++k;
int v = 0;
// expected-note@+2 {{initializer of 'j' is not a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target parallel for simd aligned(f:j)
for (I k = 0; k < argc; ++k) { ++k; v += j; }
#pragma omp target parallel for simd aligned(f)

View File

@ -28,7 +28,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target parallel for simd collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target parallel for simd collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -44,13 +44,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+3 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'collapse' clause}}
// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target parallel for simd collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-note@+2 {{read of non-const variable 'j' is not allowed in a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target parallel for simd collapse (j=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target parallel for simd collapse (1)
@ -77,12 +77,12 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target parallel for simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target parallel for simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus >= 201103L
// expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
// expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'collapse' clause}}
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5)
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp target parallel for simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-note@+2 {{read of non-const variable 'j' is not allowed in a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target parallel for simd collapse (j=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+3 {{statement after '#pragma omp target parallel for simd' must be a for loop}}

View File

@ -144,11 +144,11 @@ void test_collapse() {
#pragma omp target parallel for simd collapse(4, 8)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target parallel for simd', but found only 1}}
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target parallel for simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target parallel for simd collapse(foo())
for (i = 0; i < 16; ++i)
;
@ -379,11 +379,11 @@ void test_safelen() {
#pragma omp target parallel for simd safelen(4, 8)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target parallel for simd safelen(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target parallel for simd safelen(foo())
for (i = 0; i < 16; ++i)
;
@ -464,11 +464,11 @@ void test_simdlen() {
#pragma omp target parallel for simd simdlen(4, 8)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target parallel for simd simdlen(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target parallel for simd simdlen(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -57,7 +57,7 @@ T tmain(T argc, S **argv) {
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i - ST];
// expected-note@+2 {{read of non-const variable 'j' is not allowed in a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target parallel for simd ordered(j = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i - ST];
@ -97,13 +97,13 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target parallel for simd ordered(foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target parallel for simd ordered(foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i - 4];
#if __cplusplus >= 201103L
// expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
// expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'ordered' clause}}
// expected-error@+1 {{argument to 'ordered' clause must be a strictly positive integer value}}
#pragma omp target parallel for simd ordered(foobool(argc)), ordered(true), ordered(-5)
@ -113,7 +113,7 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i - 4];
// expected-note@+2 {{read of non-const variable 'j' is not allowed in a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target parallel for simd ordered(j = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i - 4];

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target parallel for simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target parallel for simd safelen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target parallel for simd safelen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp target parallel for simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target parallel for simd safelen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp target parallel for simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -30,7 +30,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target parallel for simd simdlen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -47,7 +47,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
// expected-error@+6 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'simdlen' clause}}
// expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -58,7 +58,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -99,14 +99,14 @@ int main(int argc, char **argv) {
#pragma omp target parallel for simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target parallel for simd simdlen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -119,7 +119,7 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -151,7 +151,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
for (I k = 0; k < argc; ++k) ++k;
int v = 0;
// expected-note@+2 {{initializer of 'j' is not a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target simd aligned(f:j)
for (I k = 0; k < argc; ++k) { ++k; v += j; }
#pragma omp target simd aligned(f)

View File

@ -26,7 +26,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target simd collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target simd collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -42,13 +42,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+3 2 {{directive '#pragma omp target simd' cannot contain more than one 'collapse' clause}}
// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target simd collapse (foobool(argc)), collapse (true), collapse (-5)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target simd collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-note@+2 {{read of non-const variable 'j' is not allowed in a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target simd collapse (j=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target simd collapse (1)
@ -75,12 +75,12 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus >= 201103L
// expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
// expected-error@+2 2 {{directive '#pragma omp target simd' cannot contain more than one 'collapse' clause}}
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target simd collapse (foobool(argc)), collapse (true), collapse (-5)
@ -88,7 +88,7 @@ int main(int argc, char **argv) {
#pragma omp target simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-note@+2 {{read of non-const variable 'j' is not allowed in a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target simd collapse (j=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+3 {{statement after '#pragma omp target simd' must be a for loop}}

View File

@ -144,11 +144,11 @@ void test_collapse() {
#pragma omp target simd collapse(4, 8)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target simd', but found only 1}}
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target simd collapse(foo())
for (i = 0; i < 16; ++i)
;
@ -369,11 +369,11 @@ void test_safelen() {
#pragma omp target simd safelen(4, 8)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target simd safelen(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target simd safelen(foo())
for (i = 0; i < 16; ++i)
;
@ -454,11 +454,11 @@ void test_simdlen() {
#pragma omp target simd simdlen(4, 8)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target simd simdlen(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target simd simdlen(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target simd safelen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp target simd' cannot contain more than one 'safelen' clause}}
// expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target simd safelen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp target simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target simd safelen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp target simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -30,7 +30,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target simd simdlen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -47,7 +47,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
// expected-error@+6 2 {{directive '#pragma omp target simd' cannot contain more than one 'simdlen' clause}}
// expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -58,7 +58,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -99,14 +99,14 @@ int main(int argc, char **argv) {
#pragma omp target simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target simd simdlen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -119,7 +119,7 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -33,7 +33,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target teams distribute collapse (argc
for (int i = ST; i < N; i++)
@ -57,7 +57,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+3 2 {{directive '#pragma omp target teams distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target teams distribute collapse (foobool(argc)), collapse (true), collapse (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -67,7 +67,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -109,7 +109,7 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp target teams distribute', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -120,7 +120,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+5{{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
// expected-error@+2 2 {{directive '#pragma omp target teams distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target teams distribute collapse (foobool(argc)), collapse (true), collapse (-5)
@ -132,7 +132,7 @@ int main(int argc, char **argv) {
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -142,11 +142,11 @@ void test_collapse() {
#pragma omp target teams distribute collapse(4, 8)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target teams distribute', but found only 1}}
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target teams distribute collapse(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target teams distribute collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -33,7 +33,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target teams distribute parallel for collapse (argc
for (int i = ST; i < N; i++)
@ -57,7 +57,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'collapse' clause}}
// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -69,7 +69,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#if __cplusplus >= 201103L
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type}}
#else
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
#endif
#pragma omp target teams distribute parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++)
@ -112,14 +112,14 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used}}
#endif
#pragma omp target teams distribute parallel for collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target teams distribute parallel for collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus >= 201103L
// expected-note@+5 {{non-constexpr function 'foobool' cannot be used}}
#endif
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
// expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'collapse' clause}}
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5)
@ -133,7 +133,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type}}
#else
// expected-error@+2 {{expression is not an integral constant expression}}
// expected-error@+2 {{integral constant expression}}
#endif
#pragma omp target teams distribute parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++)

View File

@ -142,11 +142,11 @@ void test_collapse() {
#pragma omp target teams distribute parallel for collapse(4, 8)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target teams distribute parallel for', but found only 1}}
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target teams distribute parallel for collapse(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target teams distribute parallel for collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -167,7 +167,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
int v = 0;
#pragma omp target teams distribute parallel for simd aligned(f:j) // expected-note {{initializer of 'j' is not a constant expression}} expected-error {{expression is not an integral constant expression}}
#pragma omp target teams distribute parallel for simd aligned(f:j) // expected-note {{initializer of 'j' is not a constant expression}} expected-error {{integral constant expression}}
for (I k = 0; k < argc; ++k) { ++k; v += j; }

View File

@ -33,7 +33,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target teams distribute parallel for simd collapse (argc
for (int i = ST; i < N; i++)
@ -57,7 +57,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'collapse' clause}}
// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target teams distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -69,7 +69,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#if __cplusplus >= 201103L
// expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type}}
#else
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
#endif
#pragma omp target teams distribute parallel for simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++)
@ -112,14 +112,14 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used}}
#endif
#pragma omp target teams distribute parallel for simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target teams distribute parallel for simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus >= 201103L
// expected-note@+5 {{non-constexpr function 'foobool' cannot be used}}
#endif
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
// expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'collapse' clause}}
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target teams distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5)
@ -133,7 +133,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type}}
#else
// expected-error@+2 {{expression is not an integral constant expression}}
// expected-error@+2 {{integral constant expression}}
#endif
#pragma omp target teams distribute parallel for simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++)

View File

@ -144,11 +144,11 @@ void test_collapse() {
#pragma omp target teams distribute parallel for simd collapse(4, 8)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target teams distribute parallel for simd', but found only 1}}
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target teams distribute parallel for simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target teams distribute parallel for simd collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -32,7 +32,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target teams distribute parallel for simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target teams distribute parallel for simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{expression is not an integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
#pragma omp target teams distribute parallel for simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -63,7 +63,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -106,7 +106,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target teams distribute parallel for simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target teams distribute parallel for simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -115,7 +115,7 @@ int main(int argc, char **argv) {
#endif
// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -125,7 +125,7 @@ int main(int argc, char **argv) {
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -32,7 +32,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target teams distribute parallel for simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target teams distribute parallel for simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{expression is not an integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
#pragma omp target teams distribute parallel for simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -63,7 +63,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -106,7 +106,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target teams distribute parallel for simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target teams distribute parallel for simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -115,7 +115,7 @@ int main(int argc, char **argv) {
#endif
// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -125,7 +125,7 @@ int main(int argc, char **argv) {
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -167,7 +167,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
int v = 0;
#pragma omp target teams distribute simd aligned(f:j) // expected-note {{initializer of 'j' is not a constant expression}} expected-error {{expression is not an integral constant expression}}
#pragma omp target teams distribute simd aligned(f:j) // expected-note {{initializer of 'j' is not a constant expression}} expected-error {{integral constant expression}}
for (I k = 0; k < argc; ++k) { ++k; v += j; }

View File

@ -33,7 +33,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target teams distribute simd collapse (argc
for (int i = ST; i < N; i++)
@ -54,7 +54,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
// expected-error@+6 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -67,7 +67,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -112,11 +112,11 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target teams distribute simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target teams distribute simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
// expected-error@+5 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'collapse' clause}}
// expected-error@+4 {{argument to 'collapse' clause must be a strictly positive integer value}}
#if __cplusplus >= 201103L
@ -133,7 +133,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#else
// expected-error@+2 {{expression is not an integral constant expression}}
// expected-error@+2 {{integral constant expression}}
#endif
#pragma omp target teams distribute simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++)

View File

@ -144,11 +144,11 @@ void test_collapse() {
#pragma omp target teams distribute simd collapse(4, 8)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target teams distribute simd', but found only 1}}
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target teams distribute simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target teams distribute simd collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -32,7 +32,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target teams distribute simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target teams distribute simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{expression is not an integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
#pragma omp target teams distribute simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+3 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}}
// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -63,7 +63,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -106,7 +106,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target teams distribute simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target teams distribute simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -115,7 +115,7 @@ int main(int argc, char **argv) {
#endif
// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -125,7 +125,7 @@ int main(int argc, char **argv) {
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -32,7 +32,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target teams distribute simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target teams distribute simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{expression is not an integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
#pragma omp target teams distribute simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+3 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}}
// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+1 2 {{expression is not an integral constant expression}}
// expected-error@+1 2 {{integral constant expression}}
#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -63,7 +63,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -106,7 +106,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target teams distribute simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp target teams distribute simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -115,7 +115,7 @@ int main(int argc, char **argv) {
#endif
// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5)
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
@ -125,7 +125,7 @@ int main(int argc, char **argv) {
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp taskloop collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp taskloop collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp taskloop', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp taskloop' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp taskloop collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -75,13 +75,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp taskloop', but found only 1}}
#pragma omp taskloop collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp taskloop', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp taskloop collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
#pragma omp taskloop collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -179,12 +179,12 @@ void test_collapse() {
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp taskloop', but found only 1}}
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp taskloop collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp taskloop collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -151,7 +151,7 @@ template<class I, class C> int foomain(I argc, C **argv) {
for (I k = 0; k < argc; ++k) ++k;
int v = 0;
// expected-note@+2 {{initializer of 'j' is not a constant expression}}
// expected-error@+1 {{expression is not an integral constant expression}}
// expected-error@+1 {{integral constant expression}}
#pragma omp taskloop simd aligned(f:j)
for (I k = 0; k < argc; ++k) { ++k; v += j; }
#pragma omp taskloop simd aligned(f)

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp taskloop simd collapse () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp taskloop simd collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp taskloop simd', but found only 1}}
// expected-error@+6 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'collapse' clause}}
// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp taskloop simd collapse (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -75,13 +75,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp taskloop simd', but found only 1}}
#pragma omp taskloop simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp taskloop simd', but found only 1}}
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp taskloop simd collapse (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -92,7 +92,7 @@ int main(int argc, char **argv) {
#pragma omp taskloop simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -180,12 +180,12 @@ void test_collapse() {
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp taskloop simd', but found only 1}}
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp taskloop simd collapse(2.5)
for (i = 0; i < 16; ++i)
;
#pragma omp parallel
// expected-error@+1 {{expression is not an integer constant expression}}
// expected-error@+1 {{integer constant expression}}
#pragma omp taskloop simd collapse(foo())
for (i = 0; i < 16; ++i)
;

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp taskloop simd safelen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp taskloop simd safelen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'safelen' clause}}
// expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp taskloop simd safelen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp taskloop simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp taskloop simd safelen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp taskloop simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -27,7 +27,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp taskloop simd simdlen () // expected-error {{expected expression}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp taskloop simd simdlen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
@ -40,7 +40,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+6 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'simdlen' clause}}
// expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp taskloop simd simdlen (S) // expected-error {{'S' does not refer to a value}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus <= 199711L
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-error@+4 2 {{integral constant expression}}
#else
// expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
@ -73,13 +73,13 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp taskloop simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp taskloop simd simdlen (foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+6 {{expression is not an integral constant expression}}
// expected-error@+6 {{integral constant expression}}
#if __cplusplus >= 201103L
// expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
@ -90,7 +90,7 @@ int main(int argc, char **argv) {
#pragma omp taskloop simd simdlen (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus <= 199711L
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
#else
// expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif

View File

@ -36,7 +36,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+4 {{expected ')'}} expected-note@+4 {{to match this '('}}
// expected-error@+3 2 {{expression is not an integral constant expression}}
// expected-error@+3 2 {{integral constant expression}}
// expected-note@+2 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target
#pragma omp teams distribute collapse (argc
@ -64,7 +64,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+4 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
#pragma omp target
#pragma omp teams distribute collapse (foobool(argc)), collapse (true), collapse (-5)
for (int i = ST; i < N; i++)
@ -78,7 +78,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#if __cplusplus >= 201103L
// expected-error@+5 2 {{integral constant expression must have integral or unscoped enumeration type}}
#else
// expected-error@+3 2 {{expression is not an integral constant expression}}
// expected-error@+3 2 {{integral constant expression}}
#endif
#pragma omp target
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
@ -131,14 +131,14 @@ int main(int argc, char **argv) {
// expected-note@+3 {{non-constexpr function 'foobool' cannot be used}}
#endif
#pragma omp target
#pragma omp teams distribute collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp teams distribute collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus >= 201103L
// expected-note@+6 {{non-constexpr function 'foobool' cannot be used}}
#endif
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
// expected-error@+3 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target
@ -154,7 +154,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-error@+5 {{integral constant expression must have integral or unscoped enumeration type}}
#else
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
#endif
#pragma omp target
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}

View File

@ -36,7 +36,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+4 {{expected ')'}} expected-note@+4 {{to match this '('}}
// expected-error@+3 2 {{expression is not an integral constant expression}}
// expected-error@+3 2 {{integral constant expression}}
// expected-note@+2 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target
#pragma omp teams distribute parallel for collapse (argc
@ -64,7 +64,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#endif
// expected-error@+4 2 {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'collapse' clause}}
// expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-error@+2 2 {{integral constant expression}}
#pragma omp target
#pragma omp teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5)
for (int i = ST; i < N; i++)
@ -77,7 +77,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#if __cplusplus >= 201103L
// expected-error@+5 2 {{integral constant expression must have integral or unscoped enumeration type}}
#else
// expected-error@+3 2 {{expression is not an integral constant expression}}
// expected-error@+3 2 {{integral constant expression}}
#endif
#pragma omp target
#pragma omp teams distribute parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
@ -130,14 +130,14 @@ int main(int argc, char **argv) {
// expected-note@+3 {{non-constexpr function 'foobool' cannot be used}}
#endif
#pragma omp target
#pragma omp teams distribute parallel for collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
#pragma omp teams distribute parallel for collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
#if __cplusplus >= 201103L
// expected-note@+6 {{non-constexpr function 'foobool' cannot be used}}
#endif
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+4 {{integral constant expression}}
// expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'collapse' clause}}
// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target
@ -153,7 +153,7 @@ int main(int argc, char **argv) {
#if __cplusplus >= 201103L
// expected-error@+5 {{integral constant expression must have integral or unscoped enumeration type}}
#else
// expected-error@+3 {{expression is not an integral constant expression}}
// expected-error@+3 {{integral constant expression}}
#endif
#pragma omp target
#pragma omp teams distribute parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}

Some files were not shown because too many files have changed in this diff Show More