Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.c-torture/execute/pr79121.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
#if __SIZEOF_INT__ < 4 __extension__ typedef __UINT32_TYPE__ uint32_t; __extension__ typedef __INT32_TYPE__ int32_t; #else typedef unsigned uint32_t; typedef int int32_t; #endif extern void abort (void); __attribute__ ((noinline, noclone)) unsigned long long f1 (int32_t x) { return ((unsigned long long) x) << 4; } __attribute__ ((noinline, noclone)) long long f2 (uint32_t x) { return ((long long) x) << 4; } __attribute__ ((noinline, noclone)) unsigned long long f3 (uint32_t x) { return ((unsigned long long) x) << 4; } __attribute__ ((noinline, noclone)) long long f4 (int32_t x) { return ((long long) x) << 4; } int main () { if (f1 (0xf0000000) != 0xffffffff00000000) abort (); if (f2 (0xf0000000) != 0xf00000000) abort (); if (f3 (0xf0000000) != 0xf00000000) abort (); if (f4 (0xf0000000) != 0xffffffff00000000) abort (); return 0; }