From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66806 invoked by alias); 19 Mar 2015 01:40:50 -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 66796 invoked by uid 89); 19 Mar 2015 01:40:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: lgeamrelo01.lge.com Received: from lgeamrelo01.lge.com (HELO lgeamrelo01.lge.com) (156.147.1.125) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Mar 2015 01:40:48 +0000 Received: from unknown (HELO ls3.156.147.135.180) (10.186.119.203) by 156.147.1.125 with ESMTP; 19 Mar 2015 10:40:39 +0900 X-Original-SENDERIP: 10.186.119.203 X-Original-MAILFROM: hong.gyu.kim@lge.com From: Honggyu Kim To: gcc-patches@gcc.gnu.org Cc: kyrylo.tkachov@arm.com, segher@kernel.crashing.org, christophe.lyon@st.com, Honggyu Kim Subject: [PATCH v2] New testcase to check parameter passing bug Date: Thu, 19 Mar 2015 01:40:00 -0000 Message-Id: <1426729244-12509-1-git-send-email-hong.gyu.kim@lge.com> In-Reply-To: <55096746.4080404@arm.com> References: <55096746.4080404@arm.com> X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00984.txt.bz2 Hi, I have modified the test-case to check parameter passing bug based on the comments from Kyrill Tkachov, Christophe Lyon, and Segher Boessenkool as follows: 1. move from "gcc.target/arm" to "gcc.dg" 2. change "dg-do compile" to "dg-do run" Please let me know if there's still something to fix more. Thanks for your comment. Honggyu --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/pr65358.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr65358.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 77d24a1..218f908 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-03-19 Honggyu Kim + + * gcc.dg/pr65358.c: New test. + 2015-03-18 Paolo Carlini PR c++/59816 diff --git a/gcc/testsuite/gcc.dg/pr65358.c b/gcc/testsuite/gcc.dg/pr65358.c new file mode 100644 index 0000000..ba89fd4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr65358.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +struct pack +{ + int fine; + int victim; + int killer; +}; + +int __attribute__ ((__noinline__, __noclone__)) +bar (int a, int b, struct pack p) +{ + if (a != 20 || b != 30) + __builtin_abort (); + if (p.fine != 40 || p.victim != 50 || p.killer != 60) + __builtin_abort (); + return 0; +} + +int __attribute__ ((__noinline__, __noclone__)) +foo (int arg1, int arg2, int arg3, struct pack p) +{ + return bar (arg2, arg3, p); +} + +int main (void) +{ + struct pack p = { 40, 50, 60 }; + + (void) foo (10, 20, 30, p); + return 0; +} -- 1.7.9.5