aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c
blob: 06a8a376b8b47dc6a36c9d9f17324b56b2170a7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */


int foo()
{
  int i;
  *(long*)&i = 0;  /* { dg-warning "type-punn" "type-punn" } */
  return i;
}

/* These messages are only expected for lp64, but fail there.  When they
   pass for lp64, replace "xfail *-*-*" with "target lp64".  */
/* { dg-message "does break strict-aliasing" "break" { xfail *-*-* } 8 } */
/* { dg-message "initialized" "init" { xfail *-*-* } 8 } */