Missed testcases in earlier commit.

2008-01-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR 32102
testsuite/
	* gcc.dg/Wstrict-overflow-21.c: New.
	* g++.dg/warn/Wstrict-aliasing-8.C: New.

From-SVN: r131722
parent 230a3572
/* { dg-do compile } */
/* { dg-options "-Wstrict-aliasing=2 -O2 -Wall" } */
int a[2];
double *foo1(void)
{
return (double *)a; /* { dg-warning "strict-aliasing" } */
}
double *foo2(void)
{
return (double *)&a[0]; /* { dg-warning "strict-aliasing" } */
}
__complex__ double x;
int *bar(void)
{
return (int *)&__imag__ x; /* { dg-warning "strict-aliasing" } */
}
/* PR 32102: -Wall stomps on -Wstrict-overflow */
/* { dg-do compile } */
/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=2 -Wall" } */
int
foo ()
{
int i, bits;
for (i = 1, bits = 1; i > 0; i += i) /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
++bits;
return bits;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment