1 /* { dg-do compile } */ 2 /* { dg-options "-O -Wstrict-aliasing -fstrict-aliasing" } */ 3 4 extern int flag; 5 foo()6int foo() { 7 8 int x; 9 int y = 9; 10 float* q; 11 float* r; 12 13 if (flag) { 14 q = (float*) &x; /* { dg-message "initialized" "" { xfail *-*-* } } */ 15 } else { 16 q = (float*) &y; /* { dg-message "initialized" "" { xfail *-*-* } } */ 17 } 18 19 *q = 1.0; /* { dg-warning "does break strict-aliasing" "" { xfail *-*-* } } */ 20 21 return x; 22 23 } 24