summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target
diff options
context:
space:
mode:
authorolegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-01 18:47:38 +0000
committerolegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-01 18:47:38 +0000
commitaec2c863e0cfe8595cc8b49e9786cb61eb264a7d (patch)
treec4d2d8a3678e342a535878f8849bdd3189d1f049 /gcc/testsuite/gcc.target
parent037ac54f54dbfb285acf7e4272fe76a3e08e06f3 (diff)
downloadgcc-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/testsuite/gcc.target')
-rw-r--r--gcc/testsuite/gcc.target/sh/pr61142.c30
1 files changed, 30 insertions, 0 deletions
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;
+}