From: Oleg Endo Date: Sun, 1 Mar 2015 18:47:38 +0000 (+0000) Subject: re PR target/61142 ([SH] QImode/HImode @(R0,Rm),Rn does not load to Rn = R0) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f0e677d2e0e9252bd9cb32f3f606ebc7612217ba;p=gcc.git re PR target/61142 ([SH] QImode/HImode @(R0,Rm),Rn does not load to Rn = R0) gcc/testsuite/ PR target/61142 * gcc.target/sh/sh/pr61142.c: New. From-SVN: r221089 --- 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 + + PR target/61142 + * gcc.target/sh/sh/pr61142.c: New. + 2015-03-01 Eric Botcazou * 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; +}