Merge to HEAD at tree-cleanup-merge-20041024 .
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / sra-1.c
blob652f402dc834751aed9bc4f8fe7746ce28f07e79
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-optimized" } */
4 /* Tests for SRA. */
6 typedef struct teststruct
8 double d;
9 char f1;
10 } teststruct;
12 void
13 copystruct1 (teststruct param)
15 teststruct local;
16 param.f1 = 0;
17 local = param;
18 if (local.f1 != 0)
19 link_error ();
22 void
23 copystruct11 (teststruct *param)
25 teststruct local;
26 param->f1 = 0;
27 local = *param;
28 if (local.f1 != 0)
29 link_error ();
32 void
33 copystruct111 (teststruct param)
35 teststruct *local = &param;
36 param.f1 = 0;
37 if (local->f1 != 0)
38 link_error ();
41 teststruct globf;
42 void
43 copystruct1111 (void)
45 teststruct local;
46 globf.f1 = 0;
47 local = globf;
48 if (local.f1 != 0)
49 link_error ();
52 void
53 copystruct11111 (void)
55 teststruct *local = &globf;
56 globf.f1 = 0;
57 if (local->f1 != 0)
58 link_error ();
61 void
62 copystruct111111 (teststruct param)
64 static teststruct local;
65 param.f1 = 0;
66 local = param;
67 if (local.f1 != 0)
68 link_error ();
71 /* There should be no referenc to link_error. */
72 /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */