c++: add fixed test [PR109095]
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20030120-1.c
blobab088e4553c3216d31a880d7a57fbf032c54cc74
1 /* On H8/300 port, NOTICE_UPDATE_CC had a bug that causes the final
2 pass to remove test insns that should be kept. */
4 void abort (void);
5 void exit (int);
7 unsigned short
8 test1 (unsigned short w)
10 if ((w & 0xff00) == 0)
12 if (w == 0)
13 w = 2;
15 return w;
18 unsigned long
19 test2 (unsigned long w)
21 if ((w & 0xffff0000) == 0)
23 if (w == 0)
24 w = 2;
26 return w;
29 int
30 test3 (unsigned short a)
32 if (a & 1)
33 return 1;
34 else if (a)
35 return 1;
36 else
37 return 0;
40 int
41 main ()
43 if (test1 (1) != 1)
44 abort ();
46 if (test2 (1) != 1)
47 abort ();
49 if (test3 (2) != 1)
50 abort ();
52 exit (0);