PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20031106-2.c
blob73dd4ff2ec1f7f646b280e88bb6a20f61de5f0f9
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-optimized" } */
4 extern void link_error (void);
6 /* Check for dead stores to a struct. */
8 struct s
10 char d;
11 int a, b;
12 double m;
15 void foo (struct s* teststruct)
17 teststruct->a = 0;
18 teststruct->a++;
19 if (teststruct->a != 1)
20 link_error ();
23 /* There should be only one reference to "teststruct" and one in the function header. */
24 /* { dg-final { scan-tree-dump-times "teststruct" 2 "optimized" } } */
26 /* There should be no link_error calls. */
27 /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
29 /* { dg-final { cleanup-tree-dump "optimized" } } */