2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 960311-3.c
blob755fc723f85a3b9eedc156838c327e0c6ee340a3
1 #include <stdio.h>
3 #ifdef DEBUG
4 #define abort() printf ("error, line %d\n", __LINE__)
5 #endif
7 int count;
9 void a1() { ++count; }
11 void
12 b (unsigned long data)
14 if (data & 0x80000000) a1();
15 data <<= 1;
17 if (data & 0x80000000) a1();
18 data <<= 1;
20 if (data & 0x80000000) a1();
23 main ()
25 count = 0;
26 b (0);
27 if (count != 0)
28 abort ();
30 count = 0;
31 b (0x80000000);
32 if (count != 1)
33 abort ();
35 count = 0;
36 b (0x40000000);
37 if (count != 1)
38 abort ();
40 count = 0;
41 b (0x20000000);
42 if (count != 1)
43 abort ();
45 count = 0;
46 b (0xc0000000);
47 if (count != 2)
48 abort ();
50 count = 0;
51 b (0xa0000000);
52 if (count != 2)
53 abort ();
55 count = 0;
56 b (0x60000000);
57 if (count != 2)
58 abort ();
60 count = 0;
61 b (0xe0000000);
62 if (count != 3)
63 abort ();
65 #ifdef DEBUG
66 printf ("Done.\n");
67 #endif
68 exit (0);