aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/pr52483-2.c
blob: 68e7f8e2516db9acdd2956e94349e00c040a0ae8 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/* Check that loads/stores from/to volatile mems utilize displacement
   addressing modes and do not result in redundant sign/zero extensions. */
/* { dg-do compile }  */
/* { dg-options "-O1" } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } }  */
/* { dg-final { scan-assembler-times "@\\(5," 4 } } */
/* { dg-final { scan-assembler-times "@\\(10," 4 } } */
/* { dg-final { scan-assembler-times "@\\(20," 4 } } */
/* { dg-final { scan-assembler-times "@\\(40," 4 } } */
/* { dg-final { scan-assembler-times "@\\(44," 4 } } */
/* { dg-final { scan-assembler-not "exts" } } */
/* { dg-final { scan-assembler-times "extu|movu" 2 } } */

int
test_00 (volatile char* x)
{
  return x[5];
}

void
test_100 (volatile char* x, char y)
{
  x[5] = y;
}

int
test_01 (volatile short* x)
{
  return x[5];
}

void
test_101 (volatile short* x, short y)
{
  x[5] = y;
}

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

void
test_102 (volatile int* x, int y)
{
  x[5] = y;
}

long long
test_03 (volatile long long* x)
{
  return x[5];
}

void
test_103 (volatile long long* x, long long y)
{
  x[5] = y;
}

unsigned int
test_04 (volatile unsigned char* x)
{
  // expected 1x extu.b or movu.b
  return x[5];
}

void
test_104 (volatile unsigned char* x, unsigned char y)
{
  x[5] = y;
}

unsigned int
test_05 (volatile unsigned short* x)
{
  // expected 1x extu.w or movu.w
  return x[5];
}

void
test_105 (volatile unsigned short* x, unsigned short y)
{
  x[5] = y;
}
 
unsigned int
test_06 (volatile unsigned int* x)
{
  return x[5];
}

void
test_106 (volatile unsigned int* x, unsigned int y)
{
  x[5] = y;
}

unsigned long long
test_07 (volatile unsigned long long* x)
{
  return x[5];
}

void
test_107 (volatile unsigned long long* x, unsigned long long y)
{
  x[5] = y;
}