PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / alias-28.c
blobc15ca0549bef5c159ab89a565905b8db0fc18300
1 /* { dg-do run } */
2 /* { dg-options "-O3" } */
4 extern void abort (void);
5 extern void __link_error (void);
6 extern void *malloc(__SIZE_TYPE__);
8 int * __attribute__((noinline,noclone))
9 foo (int *p)
11 int *q = (int *) malloc (sizeof (int));
12 *p = 1;
13 *q = 2;
14 if (*p != 1)
15 __link_error ();
16 *p = 3;
17 return q;
20 int main()
22 int i;
23 int *p = foo (&i);
24 if (i != 3 || *p != 2)
25 abort ();
26 return 0;