PR tree-optimization/81384 - built-in form of strnlen missing
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr79121.c
blob5593acc7d297d26ed0f6ccd047a22872e12b2070
1 #if __SIZEOF_INT__ < 4
2 __extension__ typedef __UINT32_TYPE__ uint32_t;
3 __extension__ typedef __INT32_TYPE__ int32_t;
4 #else
5 typedef unsigned uint32_t;
6 typedef int int32_t;
7 #endif
9 extern void abort (void);
11 __attribute__ ((noinline, noclone)) unsigned long long f1 (int32_t x)
13 return ((unsigned long long) x) << 4;
16 __attribute__ ((noinline, noclone)) long long f2 (uint32_t x)
18 return ((long long) x) << 4;
21 __attribute__ ((noinline, noclone)) unsigned long long f3 (uint32_t x)
23 return ((unsigned long long) x) << 4;
26 __attribute__ ((noinline, noclone)) long long f4 (int32_t x)
28 return ((long long) x) << 4;
31 int main ()
33 if (f1 (0xf0000000) != 0xffffffff00000000)
34 abort ();
35 if (f2 (0xf0000000) != 0xf00000000)
36 abort ();
37 if (f3 (0xf0000000) != 0xf00000000)
38 abort ();
39 if (f4 (0xf0000000) != 0xffffffff00000000)
40 abort ();
41 return 0;