PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 960311-2.c
blobd5c2d07a336cb41dbb819ec7d6116d833476a0db
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 short data)
14 if (data & 0x8000) a1();
15 data <<= 1;
17 if (data & 0x8000) a1();
18 data <<= 1;
20 if (data & 0x8000) a1();
23 main ()
25 count = 0;
26 b (0);
27 if (count != 0)
28 abort ();
30 count = 0;
31 b (0x8000);
32 if (count != 1)
33 abort ();
35 count = 0;
36 b (0x4000);
37 if (count != 1)
38 abort ();
40 count = 0;
41 b (0x2000);
42 if (count != 1)
43 abort ();
45 count = 0;
46 b (0xc000);
47 if (count != 2)
48 abort ();
50 count = 0;
51 b (0xa000);
52 if (count != 2)
53 abort ();
55 count = 0;
56 b (0x6000);
57 if (count != 2)
58 abort ();
60 count = 0;
61 b (0xe000);
62 if (count != 3)
63 abort ();
65 #ifdef DEBUG
66 printf ("Done.\n");
67 #endif
68 exit (0);