aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/pr52483-3.c
blob: baeec334331c841a153c4e7c13f5a7b5b3586f0f (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
/* Check that loads/stores from/to volatile mems utilize indexed 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 "@\\(r0," 6 } } */
/* { dg-final { scan-assembler-not "exts|extu" } } */

int
test_00 (volatile char* x, unsigned int y)
{
  return x[y];
}

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

int
test_01 (volatile short* x, unsigned int y)
{
  return x[y];
}

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

int
test_02 (volatile int* x, unsigned int y)
{
  return x[y];
}

int
test_102 (volatile int* x, unsigned int y, int z)
{
  x[y] = z;
}