2017-08-28 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr52483-3.c
blobe0a02e08b6bf9cc0b0ca49fdd92460020f41157b
1 /* Check that loads/stores from/to volatile mems utilize indexed addressing
2 modes and do not result in redundant sign/zero extensions. */
3 /* { dg-do compile } */
4 /* { dg-options "-O1" } */
5 /* { dg-final { scan-assembler-times "@\\(r0," 6 } } */
6 /* { dg-final { scan-assembler-not "exts|extu" } } */
8 int
9 test_00 (volatile char* x, unsigned int y)
11 return x[y];
14 void
15 test_100 (volatile char* x, unsigned int y, char z)
17 x[y] = z;
20 int
21 test_01 (volatile short* x, unsigned int y)
23 return x[y];
26 void
27 test_101 (volatile short* x, unsigned int y, short z)
29 x[y] = z;
32 int
33 test_02 (volatile int* x, unsigned int y)
35 return x[y];
38 int
39 test_102 (volatile int* x, unsigned int y, int z)
41 x[y] = z;