From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91948 invoked by alias); 1 Mar 2015 18:49:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 91936 invoked by uid 89); 1 Mar 2015 18:49:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailout02.t-online.de Received: from mailout02.t-online.de (HELO mailout02.t-online.de) (194.25.134.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 01 Mar 2015 18:49:10 +0000 Received: from fwd35.aul.t-online.de (fwd35.aul.t-online.de [172.20.27.145]) by mailout02.t-online.de (Postfix) with SMTP id 039E41A475D for ; Sun, 1 Mar 2015 19:49:05 +0100 (CET) Received: from [192.168.0.106] (Zkkt5TZaohrIGrc1xzyG8WMTHSvR-hOiAAm1PxAyeuEsB3bWCxQVmyAA958IRiiZEs@[84.183.240.30]) by fwd35.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1YS8vI-3XyIeu0; Sun, 1 Mar 2015 19:49:04 +0100 Message-ID: <1425235741.16721.67.camel@yam-132-YW-E178-FTW> Subject: [SH][committed] Add test case for PR 61142 From: Oleg Endo To: gcc-patches Date: Sun, 01 Mar 2015 18:49:00 -0000 Content-Type: multipart/mixed; boundary="=-shoGCLhBNjTtih0w9bok" Mime-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00018.txt.bz2 --=-shoGCLhBNjTtih0w9bok Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 303 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. --=-shoGCLhBNjTtih0w9bok Content-Disposition: attachment; filename="sh_pr61142_3.patch" Content-Type: text/x-patch; name="sh_pr61142_3.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 922 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; +} --=-shoGCLhBNjTtih0w9bok--