* expmed.c (flip_storage_order): Deal with complex modes specially.
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr49419.c
blobfddc1646202bd5e3a6ed19629e5faea724dfbe2b
1 /* PR tree-optimization/49419 */
3 extern void abort (void);
5 struct S { int w, x, y; } *t;
7 int
8 foo (int n, int f, int *s, int m)
10 int x, i, a;
11 if (n == -1)
12 return 0;
13 for (x = n, i = 0; t[x].w == f && i < m; i++)
14 x = t[x].x;
15 if (i == m)
16 abort ();
17 a = i + 1;
18 for (x = n; i > 0; i--)
20 s[i] = t[x].y;
21 x = t[x].x;
23 s[0] = x;
24 return a;
27 int
28 main (void)
30 int s[3], i;
31 struct S buf[3] = { { 1, 1, 2 }, { 0, 0, 0 }, { 0, 0, 0 } };
32 t = buf;
33 if (foo (0, 1, s, 3) != 2)
34 abort ();
35 if (s[0] != 1 || s[1] != 2)
36 abort ();
37 return 0;