From patchwork Thu Sep 11 18:37:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Chandra Reddy X-Patchwork-Id: 2772 Received: (qmail 19982 invoked by alias); 11 Sep 2014 18:37:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 19939 invoked by uid 89); 11 Sep 2014 18:37:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oa0-f48.google.com Received: from mail-oa0-f48.google.com (HELO mail-oa0-f48.google.com) (209.85.219.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 11 Sep 2014 18:37:44 +0000 Received: by mail-oa0-f48.google.com with SMTP id g18so993037oah.21 for ; Thu, 11 Sep 2014 11:37:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=6UdZpLlJnnY6+bmJDNobhCIpIudetWy8U/y3u9xhsKQ=; b=lcvmsaQtT3tCi7vBQoEuchmVqnLkLVNKtHDgsGH3tvtVcs8Ws0UtcDoeXryYTpg3Cv UeTFBbIjqoU+MnD3uFeKJAat8SH2s7kAxSD7pO73GmXwJOKvgsvpI/qzmN/+LBuGcb9Y 6QtXZSlkhRl21/nIks5ch+yBUEu+ArDD57lrj4Sv7rWZwQjaP5pbUgArQneTnXQ5ilRl CGFPAviI7vmK4mV8nxnSsIyjxDI/sUXClIqHdTShDkSBlwzJN6yJRrR23AvXdL2Br1Iy DafF2rMSflKfQZr6yD4kpVu2aZJcvgAKhIbbSvRcuywCeI4iJNRI9KxqVVWccpR/xXVs HPKw== X-Gm-Message-State: ALoCoQk3FGuebhtxNhbsWOIG4Qik6s1UPh5A+BQSQb4Pmgbr+xJN38DeuP5Y1+/ks+vFDIeu/Pxg MIME-Version: 1.0 X-Received: by 10.60.179.163 with SMTP id dh3mr3261463oec.42.1410460662534; Thu, 11 Sep 2014 11:37:42 -0700 (PDT) Received: by 10.202.225.135 with HTTP; Thu, 11 Sep 2014 11:37:41 -0700 (PDT) Date: Thu, 11 Sep 2014 11:37:41 -0700 Message-ID: Subject: [PATCH 3/4] PR c++/13403 and PR c++/15154: Add new non-trivial return value tests From: Siva Chandra To: gdb-patches X-IsSubscribed: yes gdb/testsuite/ChangeLog: 2014-09-11 Siva Chandra Reddy * gdb.cp/non-trivial-retval.cc: Add new test cases. * gdb.cp/non-trivial-retval.exp: Add new tests. diff --git a/gdb/testsuite/gdb.cp/non-trivial-retval.cc b/gdb/testsuite/gdb.cp/non-trivial-retval.cc index c7a2d35..19867bc 100644 --- a/gdb/testsuite/gdb.cp/non-trivial-retval.cc +++ b/gdb/testsuite/gdb.cp/non-trivial-retval.cc @@ -63,6 +63,52 @@ f2 (int i1, int i2) return b; } +class C +{ +public: + virtual int method (); + + int c; +}; + +int +C::method () +{ + return c; +} + +C +f3 (int i1, int i2) +{ + C c; + + c.c = i1 + i2; + + return c; +} + +class D +{ +public: + int d; +}; + +class E : public virtual D +{ +public: + int e; +}; + +E +f4 (int i1, int i2) +{ + E e; + + e.e = i1 + i2; + + return e; +} + int main (void) { diff --git a/gdb/testsuite/gdb.cp/non-trivial-retval.exp b/gdb/testsuite/gdb.cp/non-trivial-retval.exp index a629339..10e6dbf 100644 --- a/gdb/testsuite/gdb.cp/non-trivial-retval.exp +++ b/gdb/testsuite/gdb.cp/non-trivial-retval.exp @@ -32,3 +32,5 @@ gdb_continue_to_breakpoint "Break here" gdb_test "p f1 (i1, i2)" ".*a = 11.*" "p f1 (i1, i2)" gdb_test "p f2 (i1, i2)" ".*b = 11.*" "p f2 (i1, i2)" +gdb_test "p f3 (i1, i2)" ".*c = 11.*" "p f3 (i1, i2)" +gdb_test "p f4 (i1, i2)" ".*e = 11.*" "p f4 (i1, i2)"