Remove the argument number from the constant integer diagnostic.
Update all of the testcases accordingly. llvm-svn: 101795
This commit is contained in:
parent
4d55b2d049
commit
63448c3de2
|
@ -2864,7 +2864,7 @@ def err_builtin_longjmp_invalid_val : Error<
|
|||
"argument to __builtin_longjmp must be a constant 1">;
|
||||
|
||||
def err_constant_integer_arg_type : Error<
|
||||
"argument %0 to %1 must be a constant integer">;
|
||||
"argument to %0 must be a constant integer">;
|
||||
|
||||
def ext_mixed_decls_code : Extension<
|
||||
"ISO C90 forbids mixing declarations and code">;
|
||||
|
|
|
@ -743,7 +743,7 @@ bool Sema::SemaBuiltinConstantArg(CallExpr *TheCall, int ArgNum,
|
|||
|
||||
if (!Arg->isIntegerConstantExpr(Result, Context))
|
||||
return Diag(TheCall->getLocStart(), diag::err_constant_integer_arg_type)
|
||||
<< ArgNum << FDecl->getDeclName() << Arg->getSourceRange();
|
||||
<< FDecl->getDeclName() << Arg->getSourceRange();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ void foo() {
|
|||
__builtin_prefetch(&a, 1);
|
||||
__builtin_prefetch(&a, 1, 2);
|
||||
__builtin_prefetch(&a, 1, 9, 3); // expected-error{{too many arguments to function}}
|
||||
__builtin_prefetch(&a, "hello", 2); // expected-error{{argument 1 to '__builtin_prefetch' must be a constant integer}}
|
||||
__builtin_prefetch(&a, a, 2); // expected-error{{argument 1 to '__builtin_prefetch' must be a constant integer}}
|
||||
__builtin_prefetch(&a, "hello", 2); // expected-error{{argument to '__builtin_prefetch' must be a constant integer}}
|
||||
__builtin_prefetch(&a, a, 2); // expected-error{{argument to '__builtin_prefetch' must be a constant integer}}
|
||||
__builtin_prefetch(&a, 2); // expected-error{{argument should be a value from 0 to 1}}
|
||||
__builtin_prefetch(&a, 0, 4); // expected-error{{argument should be a value from 0 to 3}}
|
||||
__builtin_prefetch(&a, -1, 4); // expected-error{{argument should be a value from 0 to 1}}
|
||||
|
|
|
@ -4,7 +4,7 @@ return __builtin_return_address(0);
|
|||
}
|
||||
|
||||
void b(unsigned x) {
|
||||
return __builtin_return_address(x); // expected-error{{argument 0 to '__builtin_return_address' must be a constant integer}}
|
||||
return __builtin_return_address(x); // expected-error{{argument to '__builtin_return_address' must be a constant integer}}
|
||||
}
|
||||
|
||||
void* c(unsigned x) {
|
||||
|
@ -12,5 +12,5 @@ return __builtin_frame_address(0);
|
|||
}
|
||||
|
||||
void d(unsigned x) {
|
||||
return __builtin_frame_address(x); // expected-error{{argument 0 to '__builtin_frame_address' must be a constant integer}}
|
||||
return __builtin_frame_address(x); // expected-error{{argument to '__builtin_frame_address' must be a constant integer}}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ void test11(int X) {
|
|||
break;
|
||||
}
|
||||
|
||||
__builtin_eh_return_data_regno(X); // expected-error {{argument 0 to '__builtin_eh_return_data_regno' must be a constant integer}}
|
||||
__builtin_eh_return_data_regno(X); // expected-error {{argument to '__builtin_eh_return_data_regno' must be a constant integer}}
|
||||
}
|
||||
|
||||
// PR5062
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
|
||||
__m64 foo(__m64 a, __m64 b, int c)
|
||||
{
|
||||
return _mm_alignr_pi8(a, b, c); // expected-error {{argument 2 to '__builtin_ia32_palignr' must be a constant integer}}
|
||||
return _mm_alignr_pi8(a, b, c); // expected-error {{argument to '__builtin_ia32_palignr' must be a constant integer}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue