aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/sh/pr58219.c
blob: d900f72eae8b8e2b762eb898e20e735a28063ef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* Check that move instructions have the correct length on SH2A.  */
/* { dg-do compile }  */
/* { dg-options "-O1 -dp" }  */

/* { dg-final { scan-assembler-times "length = 4" 10 { target { "sh2a" && any_fpu } } } }  */
/* { dg-final { scan-assembler-times "length = 4" 8 { target { "sh2a" && no_fpu } } } }  */

int
test_00 (int* x)
{
  return x[0];
}

int
test_01 (int* x)
{
  return x[1];
}

int
test_02 (int* x)
{
  return x[100];
}

int
test_03 (int* x, unsigned int y)
{
  return *(int*)((unsigned int)x + y);
}

float
test_04 (float* x)
{
  return x[0];
}

float
test_05 (float* x)
{
  return x[5];
}

float
test_06 (float* x)
{
  return x[100];
}

int
test_07 (void)
{
  return 1230;
}

int
test_08 (void)
{
  return 0xFF0000;
}