gcc/testsuite/gcc.target/mips/pr104914.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-mabi=64" } */ |
| 3 | |
| 4 | extern void abort (void); |
| 5 | extern void exit (int); |
| 6 | |
| 7 | NOMIPS16 int test (const unsigned char *buf) |
| 8 | { |
| 9 | int val; |
| 10 | ((unsigned char*)&val)[0] = *buf++; |
| 11 | ((unsigned char*)&val)[1] = *buf++; |
| 12 | ((unsigned char*)&val)[2] = *buf++; |
| 13 | ((unsigned char*)&val)[3] = *buf++; |
| 14 | if(val > 0) |
| 15 | return 1; |
| 16 | else |
| 17 | return 0; |
| 18 | } |
| 19 | |
| 20 | int main () |
| 21 | { |
| 22 | if (test("\xff\xff\xff\xff") != 0) |
| 23 | abort(); |
| 24 | exit(0); |
| 25 | } |