gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / pr19633-1.c
blob6370ff59b23432f36bbff73ee0debf4c1670b0c7
1 /* { dg-do run } */
3 /* The max-aliased-vops setting is a temporary workaround to avoid the
4 random failures as described in PR 30194. This test case does not
5 need alias sets bigger than 13 elements. */
6 /* { dg-options "-O2 --param max-aliased-vops=15" } */
8 extern void abort (void);
10 struct S
12 int w, x, y, z;
15 struct T
17 int r;
18 struct S s;
21 struct S bar (struct S x, struct S *y)
23 y->w = 4;
24 return *y;
27 void
28 foo (int a, struct T b)
30 struct S x;
31 struct S *c = &x;
32 if (a)
33 c = &b.s;
34 b.s.w = 3;
35 /* This call should be marked as clobbering 'x' and 'b'. */
36 *c = bar (*c, c);
37 if (b.s.w == 3)
38 abort ();
41 float Y;
43 struct S bar1 (struct S x, struct S y)
45 Y = 4;
46 return x;
49 void
50 foo1 (int a, struct T b)
52 struct S x;
53 struct S *c = &x;
54 float z, *k = &z;
55 if (a)
56 c = &b.s;
57 b.s.w = 3;
58 /* This call should NOT be marked as clobbering 'x' and 'b'. */
59 x = bar1 (*c, *c);
60 if (b.s.w != 3)
61 link_error ();
64 int main ()
66 struct T b;
67 foo (3, b);
68 foo1 (3, b);
69 return 0;