| 1 |
/* Check that move instructions have the correct length on SH2A. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O1 -dp" } */ |
| 4 |
|
| 5 |
/* { dg-final { scan-assembler-times "length = 4" 10 { target { "sh2a" && any_fpu } } } } */ |
| 6 |
/* { dg-final { scan-assembler-times "length = 4" 8 { target { "sh2a" && no_fpu } } } } */ |
| 7 |
|
| 8 |
int |
| 9 |
test_00 (int* x) |
| 10 |
{ |
| 11 |
return x[0]; |
| 12 |
} |
| 13 |
|
| 14 |
int |
| 15 |
test_01 (int* x) |
| 16 |
{ |
| 17 |
return x[1]; |
| 18 |
} |
| 19 |
|
| 20 |
int |
| 21 |
test_02 (int* x) |
| 22 |
{ |
| 23 |
return x[100]; |
| 24 |
} |
| 25 |
|
| 26 |
int |
| 27 |
test_03 (int* x, unsigned int y) |
| 28 |
{ |
| 29 |
return *(int*)((unsigned int)x + y); |
| 30 |
} |
| 31 |
|
| 32 |
float |
| 33 |
test_04 (float* x) |
| 34 |
{ |
| 35 |
return x[0]; |
| 36 |
} |
| 37 |
|
| 38 |
float |
| 39 |
test_05 (float* x) |
| 40 |
{ |
| 41 |
return x[5]; |
| 42 |
} |
| 43 |
|
| 44 |
float |
| 45 |
test_06 (float* x) |
| 46 |
{ |
| 47 |
return x[100]; |
| 48 |
} |
| 49 |
|
| 50 |
int |
| 51 |
test_07 (void) |
| 52 |
{ |
| 53 |
return 1230; |
| 54 |
} |
| 55 |
|
| 56 |
int |
| 57 |
test_08 (void) |
| 58 |
{ |
| 59 |
return 0xFF0000; |
| 60 |
} |