PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr51466.c
blobaa0b7fd4fb91cf50c5c7d92ecc841e27535141ce
1 /* PR tree-optimization/51466 */
3 extern void abort (void);
5 __attribute__((noinline, noclone)) int
6 foo (int i)
8 volatile int v[4];
9 int *p;
10 v[i] = 6;
11 p = (int *) &v[i];
12 return *p;
15 __attribute__((noinline, noclone)) int
16 bar (int i)
18 volatile int v[4];
19 int *p;
20 v[i] = 6;
21 p = (int *) &v[i];
22 *p = 8;
23 return v[i];
26 __attribute__((noinline, noclone)) int
27 baz (int i)
29 volatile int v[4];
30 int *p;
31 v[i] = 6;
32 p = (int *) &v[0];
33 *p = 8;
34 return v[i];
37 int
38 main ()
40 if (foo (3) != 6 || bar (2) != 8 || baz (0) != 8 || baz (1) != 6)
41 abort ();
42 return 0;