PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr24716.c
blobc2473f84c3155c581b86f0e21ab9f37873d8e96a
1 /* PR24716, scalar evolution returning the wrong result
2 for pdest. */
4 int Link[] = { -1 };
5 int W[] = { 2 };
7 extern void abort (void);
9 int f (int k, int p)
11 int pdest, j, D1361;
12 j = 0;
13 pdest = 0;
14 for (;;) {
15 if (pdest > 2)
17 j--, pdest++;
18 while (j > 2);
20 if (j == 1)
21 break;
23 while (pdest > p)
24 if (j == p)
25 pdest++;
29 D1361 = W[k];
31 if (D1361 != 0)
32 pdest = 1, W[k] = D1361 = 0;
33 while (p < 1);
34 } while (k > 0);
38 p = 0;
39 k = Link[k];
40 while (p < j)
41 if (k != -1)
42 pdest++, p++;
44 while (k != -1);
45 j = 1;
48 /* The correct return value should be pdest (1 in the call from main).
49 DOM3 is mistaken and propagates a 0 here. */
50 return pdest;
53 int main ()
55 if (!f (0, 2))
56 abort ();
57 return 0;