PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipa-pta-16.c
blob83b9cd8e1e37a4ab9d2f48e096b0e3906fa6eb80
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fno-tree-sra -fipa-pta -fdump-ipa-pta2" } */
4 struct X
6 long l1;
7 struct Y
9 long l2;
10 int *p;
11 } y;
13 int i;
14 static int __attribute__((noinline))
15 foo (struct X *x)
17 struct Y y = x->y;
18 *y.p = 0;
19 i = 1;
20 return *y.p;
22 extern void abort (void);
23 int main()
25 struct X x;
26 x.y.p = &i;
27 if (foo(&x) != 1)
28 abort ();
29 return 0;
32 /* { dg-final { scan-ipa-dump "y.\[0-9\]*\\\+\[0-9\]* = { i }" "pta2" } } */