[gcc]
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr58219.c
blobd900f72eae8b8e2b762eb898e20e735a28063ef1
1 /* Check that move instructions have the correct length on SH2A. */
2 /* { dg-do compile } */
3 /* { dg-options "-O1 -dp" } */
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 } } } } */
8 int
9 test_00 (int* x)
11 return x[0];
14 int
15 test_01 (int* x)
17 return x[1];
20 int
21 test_02 (int* x)
23 return x[100];
26 int
27 test_03 (int* x, unsigned int y)
29 return *(int*)((unsigned int)x + y);
32 float
33 test_04 (float* x)
35 return x[0];
38 float
39 test_05 (float* x)
41 return x[5];
44 float
45 test_06 (float* x)
47 return x[100];
50 int
51 test_07 (void)
53 return 1230;
56 int
57 test_08 (void)
59 return 0xFF0000;