summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/attr-may-alias-1.c
blob: 30e2bca6f48e9d033287457f4651bc9127ae9bda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler "dont_delete" } } */

typedef struct { int x; } __attribute__((may_alias)) S;

extern void dont_delete (void);

void f(S *s, float *f)
{
  s->x = 1;
  *f = 0;
  if (s->x != 1)
    dont_delete ();
}