diff options
author | Ben Cheng <bccheng@google.com> | 2014-03-25 22:37:19 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2014-03-25 22:37:19 -0700 |
commit | 1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch) | |
tree | c607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/gcc.target/sh/pr52483-2.c | |
parent | 283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff) | |
download | toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2 toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip |
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/sh/pr52483-2.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.target/sh/pr52483-2.c | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/sh/pr52483-2.c b/gcc-4.9/gcc/testsuite/gcc.target/sh/pr52483-2.c new file mode 100644 index 000000000..68e7f8e25 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/sh/pr52483-2.c @@ -0,0 +1,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; +} |