PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr29695-2.c
blob339428e32792b3d6803e6da7eb3a37e5ba857731
1 /* PR middle-end/29695 */
3 extern void abort (void);
5 int a = 128;
6 unsigned char b = 128;
7 long long c = 0x80000000LL;
8 unsigned int d = 0x80000000;
10 int
11 f1 (void)
13 return (a & 0x80) ? 0x80 : 0;
16 int
17 f2 (void)
19 return (b & 0x80) ? 0x80 : 0;
22 int
23 f3 (void)
25 return (b & 0x80) ? 0x380 : 0;
28 int
29 f4 (void)
31 return (b & 0x80) ? -128 : 0;
34 long long
35 f5 (void)
37 return (c & 0x80000000) ? 0x80000000LL : 0LL;
40 long long
41 f6 (void)
43 return (d & 0x80000000) ? 0x80000000LL : 0LL;
46 long long
47 f7 (void)
49 return (d & 0x80000000) ? 0x380000000LL : 0LL;
52 long long
53 f8 (void)
55 return (d & 0x80000000) ? -2147483648LL : 0LL;
58 int
59 main (void)
61 if ((char) 128 != -128 || (int) 0x80000000 != -2147483648)
62 return 0;
63 if (f1 () != 128)
64 abort ();
65 if (f2 () != 128)
66 abort ();
67 if (f3 () != 896)
68 abort ();
69 if (f4 () != -128)
70 abort ();
71 if (f5 () != 0x80000000LL)
72 abort ();
73 if (f6 () != 0x80000000LL)
74 abort ();
75 if (f7 () != 0x380000000LL)
76 abort ();
77 if (f8 () != -2147483648LL)
78 abort ();
79 return 0;