blob: 9adf9af00ff9c6b9b412f37638d6fd4477d465c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/* PR tree-optimization/56899 */
#if __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8
__attribute__((noinline, noclone)) void
f1 (int v)
{
int x = -214748365 * (v - 1);
if (x != -1932735285)
__builtin_abort ();
}
__attribute__((noinline, noclone)) void
f2 (int v)
{
int x = 214748365 * (v + 1);
if (x != -1932735285)
__builtin_abort ();
}
__attribute__((noinline, noclone)) void
f3 (unsigned int v)
{
unsigned int x = -214748365U * (v - 1);
if (x != -1932735285U)
__builtin_abort ();
}
__attribute__((noinline, noclone)) void
f4 (unsigned int v)
{
unsigned int x = 214748365U * (v + 1);
if (x != -1932735285U)
__builtin_abort ();
}
#endif
int
main ()
{
#if __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8
f1 (10);
f2 (-10);
f3 (10);
f4 (-10U);
#endif
return 0;
}
|