[RFA] Fix csky and c6x build failures
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr69941.c
blob7d097caf26816d169372eb8f4bb3add6b3ca293b
1 /* { dg-do run } */
3 #if __SIZEOF_INT__ < 4
4 __extension__ typedef __INT32_TYPE__ int32_t;
5 #else
6 typedef int int32_t;
7 #endif
9 int a = 0;
10 int b = 0;
11 int c = 0;
12 int32_t e = 0;
13 int f = 0;
14 int32_t *g = &e;
16 int fn1() { return b ? a : b; }
18 int main() {
19 int h = fn1() <= 0x8000000000000000ULL; // h = 1;
21 int k = f; // k = 0;
23 long i = h ? k : k / h; // i = 0;
25 long l = (unsigned short)(i - 0x1800); // l = 0xe800
27 i = l ? l : c; // i = 0xe800;
29 *g = i; // *g = 0xe800; e = 0xe800;
31 unsigned char result = e >> 9; // result = 0x74;
33 if ((int)result != 0x74)
34 __builtin_abort ();
35 return 0;