OSDN Git Service

* g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: Enhance portability.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / warn / Wstrict-aliasing-float-ref-int-obj.C
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
3
4
5 int foo() {
6   int x;
7   float& q = reinterpret_cast<float&> (x);  /* { dg-message "dereferencing type-punned" "" { target *-*-* } } */
8   q = 1.0; /* { dg-warning "does break strict-aliasing" "" { xfail *-*-* } } */
9   return x;
10 }
11
12 /* { dg-message "initialized" "" { xfail *-*-* } 7 } */