2018-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr24117.c
blob45f3417c671082b7e211890cdcc302a5aa9c66f0
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 void link_error (void);
6 typedef struct {
7 int x;
8 int z;
9 } Foo_t;
11 char *xm;
12 void bar(void);
14 void foo(void)
16 Foo_t x;
17 x.x = 1;
18 x.z = 2;
19 xm = (char *)&x;
20 bar();
21 /* We can't propagate x.z past bar, so this link_error should still be there. */
22 if (x.z != 2)
23 link_error ();
25 /* { dg-final { scan-tree-dump-times "link_error" 1 "optimized"} } */