From patchwork Sun Feb 3 20:54:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 217807 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]) by ozlabs.org (Postfix) with SMTP id 61B142C0090 for ; Mon, 4 Feb 2013 07:54:46 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1360529687; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Subject:From:To:Date:Content-Type:Mime-Version: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=/V+u31KldClM8cyBYofH ZC3tbBA=; b=cQZhjnZgWD32ZK3Qio4OPyiYBGo8Vl33qLOpjb+22hWcuLKs0a6V Gjja3QwUp2MIAiUJ5zl757f1OTlhYlKhuOlvNqMkgETw8BKHSGgYoTL7KOVehfv7 70Ro/WS1XdgShd4lGmFf/xBMi6waHIyilSrk3tTQQU/oHawe5IrsGZk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Subject:From:To:Date:Content-Type:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=kaBpsk+0FEXb1MYembH3kjtBEBP2yPTjipofPNGLK6vo1xiIS6R+NQafrFzWEI VNg+30XUul9KBQVwMkTI0IYTcdlBeEXWf747vve6fKxR9NEmjVf6C3rGjYOaVgPm jlM+RB7Fc2H3MwpLqwJPSozoh3kMWz1Xdi5mzF/5doIis=; Received: (qmail 22100 invoked by alias); 3 Feb 2013 20:54:40 -0000 Received: (qmail 22072 invoked by uid 22791); 3 Feb 2013 20:54:38 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RP_MATCHES_RCVD, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout11.t-online.de (HELO mailout11.t-online.de) (194.25.134.85) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 03 Feb 2013 20:54:29 +0000 Received: from fwd50.aul.t-online.de (fwd50.aul.t-online.de ) by mailout11.t-online.de with smtp id 1U26a3-00031Z-Lh; Sun, 03 Feb 2013 21:54:27 +0100 Received: from [192.168.0.103] (SgUkGOZa8hsMR9Mby0ltbuL-4KBNrpJplzi76jYmPay1KZQD+LaclA1ENDyhie9gfk@[93.218.155.47]) by fwd50.t-online.de with esmtp id 1U26Zz-2Mh2bw0; Sun, 3 Feb 2013 21:54:23 +0100 Message-ID: <1359924861.2367.145.camel@yam-132-YW-E178-FTW> Subject: [SH] PR 55146 - Add testcase From: Oleg Endo To: gcc-patches Date: Sun, 03 Feb 2013 21:54:21 +0100 Mime-Version: 1.0 X-IsSubscribed: yes 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 Hi, The attached patch adds the testcase as it was originally reported in the PR. Although it's not a problem on 4.8, I think it would be better to have this in the test suite. Tested with make -k check-gcc RUNTESTFLAGS="sh.exp=pr55146.c --target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}" OK for trunk? Cheers, Oleg testsuite/ChangeLog: PR target/55146: * gcc.target/sh/pr55146.c: New. Index: gcc/testsuite/gcc.target/sh/pr55146.c =================================================================== --- gcc/testsuite/gcc.target/sh/pr55146.c (revision 0) +++ gcc/testsuite/gcc.target/sh/pr55146.c (revision 0) @@ -0,0 +1,50 @@ +/* Check that the 'extu.b' instruction is generated for short jump tables. */ +/* { dg-do compile { target "sh*-*-*" } } */ +/* { dg-options "-Os" } */ +/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ +/* { dg-final { scan-assembler "extu.b" } } */ + +int +test (int arg) +{ + int rc; + switch (arg) + { + case 0: + asm ("nop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" + "nop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" + "mov r4,%0" + : "=r" (rc) + : "r" (arg)); + break; + case 1: + asm ("nop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" + "nop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" + "mov r5,%0" + : "=r" (rc) + : "r" (arg)); + break; + case 2: + asm ("nop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" + "nop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" + "mov r6,%0" + : "=r" (rc) + : "r" (arg)); + break; + case 3: + asm ("nop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" + "nop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" + "mov r7,%0" + : "=r" (rc) + : "r" (arg)); + break; + case 4: + asm ("nop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" + "nop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" + "mov r8,%0" + : "=r" (rc) + : "r" (arg)); + break; + } + return rc; +}