PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 930529-1.c
blob0f3668e7f8e08e5e489f3e07718b06e799bfe980
1 /* { dg-options { "-fwrapv" } } */
3 extern void abort (void);
4 extern void exit (int);
6 int dd (int x, int d) { return x / d; }
8 int
9 main ()
11 int i;
12 for (i = -3; i <= 3; i++)
14 if (dd (i, 1) != i / 1)
15 abort ();
16 if (dd (i, 2) != i / 2)
17 abort ();
18 if (dd (i, 3) != i / 3)
19 abort ();
20 if (dd (i, 4) != i / 4)
21 abort ();
22 if (dd (i, 5) != i / 5)
23 abort ();
24 if (dd (i, 6) != i / 6)
25 abort ();
26 if (dd (i, 7) != i / 7)
27 abort ();
28 if (dd (i, 8) != i / 8)
29 abort ();
31 for (i = ((unsigned) ~0 >> 1) - 3; i <= ((unsigned) ~0 >> 1) + 3; i++)
33 if (dd (i, 1) != i / 1)
34 abort ();
35 if (dd (i, 2) != i / 2)
36 abort ();
37 if (dd (i, 3) != i / 3)
38 abort ();
39 if (dd (i, 4) != i / 4)
40 abort ();
41 if (dd (i, 5) != i / 5)
42 abort ();
43 if (dd (i, 6) != i / 6)
44 abort ();
45 if (dd (i, 7) != i / 7)
46 abort ();
47 if (dd (i, 8) != i / 8)
48 abort ();
50 exit (0);