* [SH][committed] Add test case for PR 61142
@ 2015-03-01 18:49 Oleg Endo
0 siblings, 0 replies; only message in thread
From: Oleg Endo @ 2015-03-01 18:49 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 303 bytes --]
Hi,
This adds a test case for PR 61142.
Tested with
make -k check-gcc RUNTESTFLAGS="sh.exp=pr61142.c --target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"
Committed as r221089.
Cheers,
Oleg
gcc/testsuite/ChangeLog:
PR target/61142
* gcc.target/sh/sh/pr61142.c: New.
[-- Attachment #2: sh_pr61142_3.patch --]
[-- Type: text/x-patch, Size: 922 bytes --]
Index: gcc/testsuite/gcc.target/sh/pr61142.c
===================================================================
--- gcc/testsuite/gcc.target/sh/pr61142.c (revision 0)
+++ gcc/testsuite/gcc.target/sh/pr61142.c (revision 0)
@@ -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;
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-01 18:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-01 18:49 [SH][committed] Add test case for PR 61142 Oleg Endo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).