diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/miscomp.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/miscomp.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/miscomp.c b/gcc/testsuite/gcc.c-torture/compile/miscomp.c new file mode 100644 index 0000000..0bcb568 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/miscomp.c @@ -0,0 +1,15 @@ +unsigned char foo(unsigned long); +main() +{ + unsigned char AChar; + unsigned long ALong = 0x12345678; + + AChar = foo(ALong); + + printf("AChar = %x\n",(int)AChar); +} +unsigned char +foo( unsigned long TheLong) +{ + return( (unsigned char) (TheLong & 0xff) ); +} |