Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr29695-1.c
blob9ecb3142509d218aa49d7d1b4bdad85db2e5757c
1 /* PR middle-end/29695 */
3 extern void abort (void);
5 int
6 f1 (void)
8 int a = 128;
9 return (a & 0x80) ? 0x80 : 0;
12 int
13 f2 (void)
15 unsigned char a = 128;
16 return (a & 0x80) ? 0x80 : 0;
19 int
20 f3 (void)
22 unsigned char a = 128;
23 return (a & 0x80) ? 0x380 : 0;
26 int
27 f4 (void)
29 unsigned char a = 128;
30 return (a & 0x80) ? -128 : 0;
33 long long
34 f5 (void)
36 long long a = 0x80000000LL;
37 return (a & 0x80000000) ? 0x80000000LL : 0LL;
40 long long
41 f6 (void)
43 unsigned int a = 0x80000000;
44 return (a & 0x80000000) ? 0x80000000LL : 0LL;
47 long long
48 f7 (void)
50 unsigned int a = 0x80000000;
51 return (a & 0x80000000) ? 0x380000000LL : 0LL;
54 long long
55 f8 (void)
57 unsigned int a = 0x80000000;
58 return (a & 0x80000000) ? -2147483648LL : 0LL;
61 int
62 main (void)
64 if ((char) 128 != -128 || (int) 0x80000000 != -2147483648)
65 return 0;
66 if (f1 () != 128)
67 abort ();
68 if (f2 () != 128)
69 abort ();
70 if (f3 () != 896)
71 abort ();
72 if (f4 () != -128)
73 abort ();
74 if (f5 () != 0x80000000LL)
75 abort ();
76 if (f6 () != 0x80000000LL)
77 abort ();
78 if (f7 () != 0x380000000LL)
79 abort ();
80 if (f8 () != -2147483648LL)
81 abort ();
82 return 0;