C99 testsuite readiness: Some verified test case adjustments
The updated test cases still reproduce the bugs with old compilers. gcc/testsuite/ * gcc.c-torture/compile/pc44485.c (func_21): Add missing cast. * gcc.c-torture/compile/pr106101.c: Use builtins to avoid calls to undeclared functions. Change type of yyvsp to char ** and introduce yyvsp1 to avoid type errors. * gcc.c-torture/execute/pr111331-1.c: Add missing int. * gcc.dg/pr100512.c: Unreduce test case and suppress only -Wpointer-to-int-cast. * gcc.dg/pr103003.c: Likewise. * gcc.dg/pr103451.c: Add cast to long and suppress -Wdiv-by-zero only. * gcc.dg/pr68435.c: Avoid implicit int and missing static function implementation warning.
This commit is contained in:
parent
0fef2c89d1
commit
24eaada73d
7 changed files with 19 additions and 20 deletions
|
@ -39,7 +39,7 @@ lbl_28:for (p_25 = 0; p_25 < 9; p_25 += 1)
|
|||
if (p_25)
|
||||
goto lbl_29;
|
||||
unsigned short l_53;
|
||||
for (0; l_53; l_53 = foo)
|
||||
for (0; l_53; l_53 = (unsigned short) foo)
|
||||
{
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -24,10 +24,9 @@ static const int yycheck[] =
|
|||
};
|
||||
|
||||
|
||||
int yyparse (void)
|
||||
int yyparse (char **yyvsp, char *yyvsp1)
|
||||
{
|
||||
int yystate = 0;
|
||||
int *yyvsp = 0;
|
||||
|
||||
int yyn;
|
||||
int yyresult;
|
||||
|
@ -39,22 +38,22 @@ yyreduce:
|
|||
{
|
||||
case 72: {
|
||||
|
||||
if (strncmp( yyvsp[0], "~", 1) == 0) {
|
||||
if (__builtin_strncmp( yyvsp[0], "~", 1) == 0) {
|
||||
*(char **)&(yyval) = *ftpglob(yyvsp[0]);
|
||||
if (globerr != 0) {
|
||||
yyval = 0;
|
||||
}
|
||||
free(yyvsp[0]);
|
||||
__builtin_free(yyvsp[0]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
*++yyvsp = yyval;
|
||||
*++yyvsp1 = yyval;
|
||||
|
||||
{
|
||||
const int yyi = yypgoto[0] + *yyvsp;
|
||||
yystate = (yycheck[yyi] == *yyvsp ? 0 : 0);
|
||||
const int yyi = yypgoto[0] + *yyvsp1;
|
||||
yystate = (yycheck[yyi] == *yyvsp1 ? 0 : 0);
|
||||
}
|
||||
|
||||
return yyresult;
|
||||
|
|
|
@ -10,7 +10,7 @@ int c(int d, int e, int f) {
|
|||
int main() {
|
||||
int g = -1;
|
||||
a = c(b + 30, 29, g + 29);
|
||||
volatile t = a;
|
||||
volatile int t = a;
|
||||
if (t != 28)
|
||||
__builtin_abort();
|
||||
return 0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -w" } */
|
||||
/* { dg-options "-O2 -Wno-pointer-to-int-cast" } */
|
||||
|
||||
#include <stdint.h>
|
||||
int a;
|
||||
|
@ -15,7 +15,7 @@ void b() {
|
|||
;
|
||||
g:
|
||||
for (; a;) {
|
||||
int16_t i = &d;
|
||||
int16_t i = (int16_t) &d;
|
||||
*c = i && *f;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2" } */
|
||||
/* { dg-options "-O2 -Wno-pointer-to-int-cast" } */
|
||||
typedef char int8_t;
|
||||
int8_t c_4, uli_5;
|
||||
unsigned short us_6;
|
||||
void func_1() {
|
||||
int uli_9;
|
||||
short ptr_16ptr_11 = &uli_9; /* { dg-warning "initialization of*" } */
|
||||
short ptr_16ptr_11 = (short) &uli_9;
|
||||
for (; us_6 <= 6;)
|
||||
if ((us_6 *= uli_9) < (uli_5 || 0) ?: ((c_4 = us_6) >= us_6) - uli_5)
|
||||
uli_9 = 9;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// { dg-do compile }
|
||||
// { dg-options "-O2 -w -fnon-call-exceptions -fno-delete-dead-exceptions -fdump-tree-optimized" }
|
||||
// { dg-options "-O2 -Wno-div-by-zero -fnon-call-exceptions -fno-delete-dead-exceptions -fdump-tree-optimized" }
|
||||
|
||||
int func_10_ptr_12;
|
||||
|
||||
|
@ -11,9 +11,9 @@ void func_10(long li_8)
|
|||
func_10_ptr_12 &= 4 ? *ptr_9 : 4;
|
||||
}
|
||||
|
||||
void func_9_s_8()
|
||||
{
|
||||
func_10(func_9_s_8);
|
||||
void func_9_s_8(void)
|
||||
{
|
||||
func_10((long) func_9_s_8);
|
||||
}
|
||||
|
||||
// { dg-final { scan-tree-dump " / 0" "optimized" } }
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* { dg-do compile { target aarch64*-*-* i?86-*-* x86_64-*-* } } */
|
||||
/* { dg-options "-fdump-rtl-ce1 -O2 -w --param max-rtl-if-conversion-unpredictable-cost=100" } */
|
||||
/* { dg-options "-fdump-rtl-ce1 -O2 --param max-rtl-if-conversion-unpredictable-cost=100" } */
|
||||
/* { dg-additional-options "-march=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
|
||||
|
||||
typedef struct cpp_reader cpp_reader;
|
||||
|
@ -20,7 +20,7 @@ enum cpp_ttype
|
|||
CPP_HEADER_NAME, CPP_COMMENT, CPP_MACRO_ARG, CPP_PADDING, CPP_EOF,
|
||||
};
|
||||
|
||||
static struct op lex (cpp_reader *, int);
|
||||
struct op lex (cpp_reader *, int);
|
||||
|
||||
struct op
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ struct op
|
|||
};
|
||||
|
||||
int
|
||||
_cpp_parse_expr (pfile)
|
||||
_cpp_parse_expr (cpp_reader *pfile)
|
||||
{
|
||||
struct op init_stack[20];
|
||||
struct op *stack = init_stack;
|
||||
|
|
Loading…
Add table
Reference in a new issue