1 /* Check that loads/stores from/to volatile mems don't result in redundant
2 sign/zero extensions. */
3 /* { dg-do compile } */
4 /* { dg-options "-O2" } */
5 /* { dg-final { scan-assembler-not "exts|extu" } } */
6
7 int
8 test_00 (volatile char* x)
9 {
10 return *x;
11 }
12
13 void
14 test_100 (volatile char* x, char y)
15 {
16 *x = y;
17 }
18
19 int
20 test_01 (volatile short* x)
21 {
22 return *x;
23 }
24
25 void
26 test_101 (volatile unsigned char* x, unsigned char y)
27 {
28 *x = y;
29 }
30
31 int
32 test_02 (volatile unsigned char* x)
33 {
34 return *x == 0x80;
35 }
36
37 void
38 test_102 (volatile short* x, short y)
39 {
40 *x = y;
41 }
42
43 int
44 test_03 (volatile unsigned short* x)
45 {
46 return *x == 0xFF80;
47 }
48
49 void
50 test_103 (volatile unsigned short* x, unsigned short y)
51 {
52 *x = y;
53 }