blob: b90fb76c28bcb98d38a88c57e72914ea4c85e8fb [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-O -Wstrict-aliasing -fstrict-aliasing" } */
extern int flag;
int foo() {
int x;
int y = 9;
float* q;
float* r;
if (flag) {
q = (float*) &x; /* { dg-message "initialized" "" { xfail *-*-* } } */
} else {
q = (float*) &y; /* { dg-message "initialized" "" { xfail *-*-* } } */
}
*q = 1.0; /* { dg-warning "does break strict-aliasing" "" { xfail *-*-* } } */
return x;
}