AVR: target/84211 - Add a post reload register optimization pass.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr63464.c
blobb6a95599cbf5648220c713a11e99130ece575eca
1 /* PR tree-optimization/63464 */
2 /* { dg-do run { target int32plus } } */
4 int cnt;
6 __attribute__((noinline, noclone)) void
7 bar (int x, int y)
9 cnt++;
10 switch (y)
12 case 1:
13 if ((unsigned) x < 24U && ((1U << x) & 0x860c0cU) != 0)
14 __builtin_abort ();
15 break;
16 case 2:
17 if ((unsigned) x >= 24U || ((1U << x) & 0x860c0cU) == 0)
18 __builtin_abort ();
19 break;
20 case 3:
21 if ((unsigned) x - 43U < 40U && ((1ULL << (x - 43U)) & 0x8f0000004fULL) != 0)
22 __builtin_abort ();
23 break;
24 case 4:
25 if ((unsigned) x - 43U >= 40U || ((1ULL << (x - 43U)) & 0x8f0000004fULL) == 0)
26 __builtin_abort ();
27 break;
28 default:
29 __builtin_abort ();
33 __attribute__((noinline, noclone)) void
34 f1 (int x)
36 if (x != 2 && x != 3 && x != 10 && x != 11 && x != 17 && x != 18 && x != 23)
37 bar (x, 1);
40 __attribute__((noinline, noclone)) void
41 f2 (int x)
43 if (x == 2 || x == 3 || x == 10 || x == 11 || x == 17 || x == 18 || x == 23)
44 bar (x, 2);
47 __attribute__((noinline, noclone)) void
48 f3 (int x)
50 if (x != 43 && x != 76 && x != 44 && x != 78 && x != 49
51 && x != 77 && x != 46 && x != 75 && x != 45 && x != 82)
52 bar (x, 3);
55 __attribute__((noinline, noclone)) void
56 f4 (int x)
58 if (x == 43 || x == 76 || x == 44 || x == 78 || x == 49
59 || x == 77 || x == 46 || x == 75 || x == 45 || x == 82)
60 bar (x, 4);
63 int
64 main ()
66 int i;
67 f1 (-__INT_MAX__ - 1);
68 for (i = -3; i < 92; i++)
69 f1 (i);
70 f1 (__INT_MAX__);
71 if (cnt != 97 - 7)
72 __builtin_abort ();
73 f2 (-__INT_MAX__ - 1);
74 for (i = -3; i < 92; i++)
75 f2 (i);
76 f2 (__INT_MAX__);
77 if (cnt != 97)
78 __builtin_abort ();
79 f3 (-__INT_MAX__ - 1);
80 for (i = -3; i < 92; i++)
81 f3 (i);
82 f3 (__INT_MAX__);
83 if (cnt != 97 * 2 - 10)
84 __builtin_abort ();
85 f4 (-__INT_MAX__ - 1);
86 for (i = -3; i < 92; i++)
87 f4 (i);
88 f4 (__INT_MAX__);
89 if (cnt != 97 * 2)
90 __builtin_abort ();
91 return 0;