From patchwork Tue Nov 5 20:44:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 288652 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 41F872C009C for ; Wed, 6 Nov 2013 07:45:07 +1100 (EST) 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=CwMRBYMnT9s13IV4ld0wgJfBk5isVQEsKVlXZ6GBtHYIPt Q1EsmprwydiAGd859RNW7m9BDX2x7NUL9VH5vYGcyFMebphaQj/0dr3RkaCLNe01 ZluB9dB4VS2Qj5HPLkIXfJfwsGyQwVJC0zK5Yrjlj2NGJ1HYvsQDzvzOQ3rBU= 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=wqztdXReeCjcaZTJyETCuILb2wE=; b=Ag1SE4u/5Tp+ipmiiLUM yPMjUpFNfAqC+TpJSOnjDvE3wR4ArpCMePFIgCmvWJof27lRSOK1xIV18xvHIjxF ZcyXnnAZpi7vudW5KB9i0uzgiyu9NHaTxn+rERN5oNKryas9MlV8uWbsss9E0pU4 1il7w96G+qfFrX7LQb82IKU= Received: (qmail 13439 invoked by alias); 5 Nov 2013 20:44:57 -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 13416 invoked by uid 89); 5 Nov 2013 20:44:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL, BAYES_50, RCVD_IN_BL_SPAMCOP_NET, RDNS_NONE, UNPARSEABLE_RELAY, WEIRD_QUOTING autolearn=no version=3.3.2 X-HELO: mailout04.t-online.de Received: from Unknown (HELO mailout04.t-online.de) (194.25.134.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Nov 2013 20:44:56 +0000 Received: from fwd14.aul.t-online.de (fwd14.aul.t-online.de ) by mailout04.t-online.de with smtp id 1VdnUM-0004wB-OB; Tue, 05 Nov 2013 21:44:38 +0100 Received: from [192.168.0.103] (XGvGp-ZSQhDGlbbZpoS5QP37dPylBHoNFe84UYGI2Vd7GM0Uj7wu7ZH--qxKStRgNa@[93.195.5.246]) by fwd14.t-online.de with esmtp id 1VdnUI-0s7srg0; Tue, 5 Nov 2013 21:44:34 +0100 Message-ID: <1383684273.2445.401.camel@yam-132-YW-E178-FTW> Subject: [SH] PR 30807 - Add test case From: Oleg Endo To: gcc-patches Date: Tue, 05 Nov 2013 21:44:33 +0100 Mime-Version: 1.0 X-IsSubscribed: yes Hi, This adds a test case for PR 30807 which is based on the PR's attachment 17961. Tested with make -k check-gcc RUNTESTFLAGS="sh-torture.exp --target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb} OK to add? Cheers, Oleg testsuite/ChangeLog: PR target/30807 gcc.target/sh/torture/pr30807.c: New. Index: gcc/testsuite/gcc.target/sh/torture/pr30807.c =================================================================== --- gcc/testsuite/gcc.target/sh/torture/pr30807.c (revision 0) +++ gcc/testsuite/gcc.target/sh/torture/pr30807.c (revision 0) @@ -0,0 +1,218 @@ +/* { dg-do compile { target "sh*-*-*" } } */ +/* { dg-additional-options "-fpic -std=c99" } */ +/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ + +typedef unsigned int size_t; +typedef struct +{ + unsigned long __val[(1024 / (8 * sizeof (unsigned long)))]; +} __sigset_t; +struct __jmp_buf_tag +{ + __sigset_t __saved_mask; +}; +typedef struct __jmp_buf_tag sigjmp_buf[1]; +struct stat +{ + long long st_dev; + unsigned short int __pad1; + int tm_isdst; + long int tm_gmtoff; + char *tm_zone; +}; + +typedef size_t STRLEN; +typedef struct op OP; +typedef struct cop COP; +typedef struct interpreter PerlInterpreter; +typedef struct sv SV; +typedef struct av AV; +typedef struct cv CV; +typedef struct gp GP; +typedef struct gv GV; +typedef struct xpv XPV; +typedef struct xpvio XPVIO; +typedef union any ANY; +typedef unsigned char U8; +typedef long I32; +typedef unsigned long U32; +typedef U32 line_t; +typedef struct _PerlIO PerlIOl; +typedef PerlIOl *PerlIO; +struct sv +{ + void *sv_any; + U32 sv_flags; + union + { + char *svu_pv; + } sv_u; +}; +struct gv +{ + U32 sv_flags; + union + { + GP *svu_gp; + } sv_u; +}; +struct io +{ + XPVIO *sv_any; +}; +struct xpv +{ + STRLEN xpv_cur; +}; +struct xpvio +{ + PerlIO *xio_ofp; +}; +struct gp +{ + SV *gp_sv; + struct io *gp_io; +}; +struct jmpenv +{ + struct jmpenv *je_prev; + sigjmp_buf je_buf; + int je_ret; +}; +typedef struct jmpenv JMPENV; +struct cop +{ + line_t cop_line; + struct refcounted_he *cop_hints_hash; +}; +struct interpreter +{ + SV **Istack_sp; + OP *Iop; + SV **Icurpad; + SV **Istack_base; + SV **Istack_max; + I32 *Iscopestack; + I32 Iscopestack_ix; + I32 Iscopestack_max; + ANY *Isavestack; + I32 Isavestack_ix; + I32 Isavestack_max; + SV **Itmps_stack; + I32 Itmps_ix; + I32 Itmps_floor; + I32 Itmps_max; + I32 Imodcount; + I32 *Imarkstack; + I32 *Imarkstack_ptr; + I32 *Imarkstack_max; + SV *ISv; + XPV *IXpv; + STRLEN Ina; + struct stat Istatbuf; + struct stat Istatcache; + OP *Irestartop; + COP *volatile Icurcop; + JMPENV *Itop_env; + U8 Iexit_flags; + I32 Istatusvalue; + I32 Istatusvalue_posix; + GV *Istderrgv; + GV *Ierrgv; + AV *Ibeginav; + AV *Iunitcheckav; + COP Icompiling; + char Isavebegin; + volatile U32 Idebug; + AV *Ibeginav_save; + AV *Icheckav_save; + AV *Iunitcheckav_save; +}; + +void S_my_exit_jump (PerlInterpreter *my_perl __attribute__((unused))) + __attribute__((noreturn)); + +int Perl_av_len (PerlInterpreter*, AV*); +void Perl_av_create_and_push (PerlInterpreter*, AV**, SV*); +int __sigsetjmp (sigjmp_buf env, int savemask); +void Perl_sv_2pv_flags (PerlInterpreter*, SV*, STRLEN*, int); +void Perl_deb (PerlInterpreter*, + const char*, const char*, int, const char*, int); +void Perl_croak (PerlInterpreter*, const char*, void*); +void foo (void); + +void +Perl_call_list (PerlInterpreter *my_perl __attribute__((unused)), + I32 oldscope, AV *paramList) +{ + SV *atsv; + CV *cv; + STRLEN len; + int ret; + JMPENV cur_env; + GV *shplep; + volatile line_t oldline; + + oldline = (my_perl->Icurcop) ? my_perl->Icurcop->cop_line : 0; + + while (Perl_av_len (my_perl, paramList) >= 0) + { + if (my_perl->Isavebegin) + { + if (paramList == my_perl->Ibeginav) + { + Perl_av_create_and_push (my_perl, &my_perl->Ibeginav_save, + (SV*) cv); + Perl_av_create_and_push(my_perl, &my_perl->Icheckav_save, + (SV*) cv); + } + else if (paramList == my_perl->Iunitcheckav) + Perl_av_create_and_push(my_perl, &my_perl->Iunitcheckav_save, + (SV*) cv); + } + + cur_env.je_ret = __sigsetjmp (cur_env.je_buf, 0); + + switch (ret) + { + case 0: + shplep = (GV *) my_perl->Ierrgv; + *my_perl->Imarkstack_ptr = my_perl->Istack_sp - my_perl->Istack_base; + atsv = shplep->sv_u.svu_gp->gp_sv; + if (atsv->sv_flags & 0x00000400 == 0x00000400) + len = ((XPV*) ((SV *) atsv)->sv_any)->xpv_cur; + else + Perl_sv_2pv_flags (my_perl, atsv, &len, 2|32); + + if (len) + { + my_perl->Icurcop = &my_perl->Icompiling; + while (my_perl->Iscopestack_ix > oldscope) + { + if (my_perl->Idebug & 0x00000004) + Perl_deb (my_perl, "scope", "LEAVE", + my_perl->Iscopestack_ix, "perl.c", 5166); + (my_perl->Itop_env) = cur_env.je_prev; + } + + Perl_croak (my_perl, "%""-p""", (void*) atsv); + } + + case 1: + my_perl->Istatusvalue = 1; + my_perl->Istatusvalue_posix = 1; + case 2: + while (my_perl->Iscopestack_ix > oldscope) + if (my_perl->Idebug & 0x00000004) + foo (); + my_perl->Icurcop = &my_perl->Icompiling; + my_perl->Icurcop->cop_line = oldline; + if (my_perl->Idebug & 0x00000004) + foo (); + S_my_exit_jump (my_perl); + case 3: + if (my_perl->Irestartop) + foo (); + } + } +}