Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* { dg-do compile } */ |
2 /* { dg-options "-O -Wstrict-aliasing -fstrict-aliasing" } */ | |
3 | |
4 extern int flag; | |
5 | |
6 int 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 } |