From: olegendo Date: Sun, 1 Mar 2015 18:47:38 +0000 (+0000) Subject: gcc/testsuite/ X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aec2c863e0cfe8595cc8b49e9786cb61eb264a7d;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 33d69b01adf1..d8f5180059c1 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 000000000000..4f48b0500d45 --- /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; +}