aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/alias-1.c
blob: d542f23b3b5dc86b256550c8b0063494b82e7dcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int val;

int *ptr = &val;
float *ptr2 = (float *) &val;

__attribute__((optimize ("-fno-strict-aliasing")))
void
typepun (void)
{
  *ptr2=0;
}

int
main(void)
{
  *ptr=1;
  typepun ();
  if (*ptr)
    __builtin_abort ();
}