PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr47337.c
blobea88484a2469b49cec72a84ebe01327a554f12d2
1 /* PR rtl-optimization/47337 */
3 static unsigned int a[256], b = 0;
4 static char c = 0;
5 static int d = 0, *f = &d;
6 static long long e = 0;
8 static short
9 foo (long long x, long long y)
11 return x / y;
14 static char
15 bar (char x, char y)
17 return x - y;
20 static int
21 baz (int x, int y)
23 *f = (y != (short) (y * 3));
24 for (c = 0; c < 2; c++)
26 lab:
27 if (d)
29 if (e)
30 e = 1;
31 else
32 return x;
34 else
36 d = 1;
37 goto lab;
39 f = &d;
41 return x;
44 static void
45 fnx (unsigned long long x, int y)
47 if (!y)
49 b = a[b & 1];
50 b = a[b & 1];
51 b = a[(b ^ (x & 1)) & 1];
52 b = a[(b ^ (x & 1)) & 1];
56 char *volatile w = "2";
58 int
59 main ()
61 int h = 0;
62 unsigned int k = 0;
63 int l[8];
64 int i, j;
66 if (__builtin_strcmp (w, "1") == 0)
67 h = 1;
69 for (i = 0; i < 256; i++)
71 for (j = 8; j > 0; j--)
72 k = 1;
73 a[i] = k;
75 for (i = 0; i < 8; i++)
76 l[i] = 0;
78 d = bar (c, c);
79 d = baz (c, 1 | foo (l[0], 10));
80 fnx (d, h);
81 fnx (e, h);
83 if (d != 0)
84 __builtin_abort ();
85 return 0;