PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr56899.c
blob9adf9af00ff9c6b9b412f37638d6fd4477d465c6
1 /* PR tree-optimization/56899 */
3 #if __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8
4 __attribute__((noinline, noclone)) void
5 f1 (int v)
7 int x = -214748365 * (v - 1);
8 if (x != -1932735285)
9 __builtin_abort ();
12 __attribute__((noinline, noclone)) void
13 f2 (int v)
15 int x = 214748365 * (v + 1);
16 if (x != -1932735285)
17 __builtin_abort ();
20 __attribute__((noinline, noclone)) void
21 f3 (unsigned int v)
23 unsigned int x = -214748365U * (v - 1);
24 if (x != -1932735285U)
25 __builtin_abort ();
28 __attribute__((noinline, noclone)) void
29 f4 (unsigned int v)
31 unsigned int x = 214748365U * (v + 1);
32 if (x != -1932735285U)
33 __builtin_abort ();
35 #endif
37 int
38 main ()
40 #if __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8
41 f1 (10);
42 f2 (-10);
43 f3 (10);
44 f4 (-10U);
45 #endif
46 return 0;