From patchwork Sun Mar 1 18:49:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 444777 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 79CE41400D5 for ; Mon, 2 Mar 2015 05:49:21 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=TwR6d4ni; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=FALl7PYF4c207oYfAT1s6Dx6Q+sNrfE1lXMgN/zELRxCSU eCKd30vgNB/WFu0yX1GAFVtVYG+wvSj17V6kkzcgy6jmkf0nnJ46zJ1zhfCvF5GY KZJ2TX72EZpuilKxRfJaS7RRYd40XzMGcN6UfG+1LOc+jJrCsBFeG0uFO7AZ0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; s= default; bh=tjTjM0IOEeC6itMZylafaiMULvo=; b=TwR6d4niM3wBvW6WUc/u ZxuHfw2hMYXx1CLXyGKy9++QNcLuh8HFgjRKdgLVqSDVNxEa+K6V5lTdIY9O/BUa zqPdpxsOvjk5mw+i57pvYLXQN1o4KOp8YnVWS+QEvEv1E7QrL/SQHv2yEiWzWMT4 /Tn07YH1G8X88VkCeg0DDzM= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 19:49:01 +0100 Mime-Version: 1.0 X-IsSubscribed: yes 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. 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; +}