diff options
author | olegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-01 18:47:38 +0000 |
---|---|---|
committer | olegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-01 18:47:38 +0000 |
commit | aec2c863e0cfe8595cc8b49e9786cb61eb264a7d (patch) | |
tree | c4d2d8a3678e342a535878f8849bdd3189d1f049 /gcc | |
parent | 037ac54f54dbfb285acf7e4272fe76a3e08e06f3 (diff) | |
download | gcc-aec2c863e0cfe8595cc8b49e9786cb61eb264a7d.tar.gz |
gcc/testsuite/
PR target/61142
* gcc.target/sh/sh/pr61142.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221089 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sh/pr61142.c | 30 |
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 33d69b01adf..d8f5180059c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-01 Oleg Endo <olegendo@gcc.gnu.org> + + PR target/61142 + * gcc.target/sh/sh/pr61142.c: New. + 2015-03-01 Eric Botcazou <ebotcazou@adacore.com> * g++.dg/other/dump-ada-spec-3.C: New test. diff --git a/gcc/testsuite/gcc.target/sh/pr61142.c b/gcc/testsuite/gcc.target/sh/pr61142.c new file mode 100644 index 00000000000..4f48b0500d4 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/pr61142.c @@ -0,0 +1,30 @@ +/* Check that @(r0,rm),rn insns load into r0. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-times "mov.b\t@\\(r0,r\[0123456789\]\\),r0" 1 } } */ +/* { dg-final { scan-assembler-times "mov.w\t@\\(r0,r\[0123456789\]\\),r0" 1 } } */ +/* { dg-final { scan-assembler-times "mov.l\t@\\(r0,r\[0123456789\]\\),r0" 1 } } */ + +int +test_00 (const char* x, int a, int b, int c) +{ + if (x[a] == 92) + return b; + return c; +} + +int +test_01 (const short* x, int a, int b, int c) +{ + if (x[a] == 92) + return b; + return c; +} + +int +test_02 (const int* x, int a, int b, int c) +{ + if (x[a] == 92) + return b; + return c; +} |