From patchwork Wed Jun 5 10:34:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 17541 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 23F8820F5A for ; Wed, 5 Jun 2013 10:34:46 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id m1sf1647475ves.7 for ; Wed, 05 Jun 2013 03:34:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:message-id :date:from:user-agent:mime-version:to:cc:subject:x-gm-message-state :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=kk7oiiJzqSg188/x+x6IVfnKSHScH+/iDF97zpyVKC0=; b=o6wpXCpbCgujj7iQmUqN3Pyu9mpmo/awz8yqUAbUhrdwlZfDTICpOE+kGVImfX6QbH Mzb4stE3/CtgvEowclwXfF6FR+4ut44TBRVbzuWkx7aqR0WnYPu/IDo4DzTOIVGZbNWT UHQUT+XM4cC83AZHHWWRw7DwfryL3ilhhaCmIIOmXPOfqJqWF/66Zt+X4A4UC0VsVXT6 IBRkhYxnydFtCA04GzBQ+gmoNN7wetb9IzQLxqY09jl5fkOoY4mHnjZWqtQMvxHdCzbh 7QY6cCvEjB7mRtTHR2ZUJYepCQgQu0BZPjJJhDXRBr8awLPeVfh5Qn0dOvRrDiHayCm8 7tOA== X-Received: by 10.224.165.143 with SMTP id i15mr18619939qay.0.1370428485341; Wed, 05 Jun 2013 03:34:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.50 with SMTP id f18ls745218qey.20.gmail; Wed, 05 Jun 2013 03:34:45 -0700 (PDT) X-Received: by 10.220.19.74 with SMTP id z10mr17437067vca.45.1370428484922; Wed, 05 Jun 2013 03:34:44 -0700 (PDT) Received: from mail-vb0-x235.google.com (mail-vb0-x235.google.com [2607:f8b0:400c:c02::235]) by mx.google.com with ESMTPS id mo4si39411101vcb.4.2013.06.05.03.34.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Jun 2013 03:34:44 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::235; Received: by mail-vb0-f53.google.com with SMTP id p12so946821vbe.26 for ; Wed, 05 Jun 2013 03:34:44 -0700 (PDT) X-Received: by 10.52.157.138 with SMTP id wm10mr17219262vdb.57.1370428484645; Wed, 05 Jun 2013 03:34:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp12748vcb; Wed, 5 Jun 2013 03:34:43 -0700 (PDT) X-Received: by 10.204.231.137 with SMTP id jq9mr7576197bkb.150.1370428483285; Wed, 05 Jun 2013 03:34:43 -0700 (PDT) Received: from mail-bk0-x22f.google.com (mail-bk0-x22f.google.com [2a00:1450:4008:c01::22f]) by mx.google.com with ESMTPS id yh6si26198980bkb.33.2013.06.05.03.34.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Jun 2013 03:34:43 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4008:c01::22f is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=2a00:1450:4008:c01::22f; Received: by mail-bk0-f47.google.com with SMTP id jg1so574379bkc.6 for ; Wed, 05 Jun 2013 03:34:42 -0700 (PDT) X-Received: by 10.205.115.5 with SMTP id fc5mr9385912bkc.155.1370428482613; Wed, 05 Jun 2013 03:34:42 -0700 (PDT) Received: from localhost.localdomain (cpc11-seac20-2-0-cust84.7-2.cable.virginmedia.com. [81.108.156.85]) by mx.google.com with ESMTPSA id da16sm25210620bkb.2.2013.06.05.03.34.40 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 05 Jun 2013 03:34:41 -0700 (PDT) Message-ID: <51AF143F.8000205@linaro.org> Date: Wed, 05 Jun 2013 11:34:39 +0100 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: patches@linaro.org Subject: [PATCH 2/3] gdb/testsuite/gdb.cp: Fix tests for ARM C++ ABI. X-Gm-Message-State: ALoCoQn8qF+90JrsSosFtm0o1d/vrpaYDUwMR8VDRsSJo00q9B9HrdgNZnU/xqT4sQpIUTsr9ITp X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The ARM C++ ABI defines constructors and destructors to return pointers to this. The C++ tests that check the types of constructors and destructors expect a return type of void. Conditionalize these tests so they pass on ARM. gdb/testsuite/ChangeLog: 2013-06-05 Will Newton * gdb.cp/anon-struct.exp: Conditionalize constructor and destructor prototypes for ARM ABI. * gdb.cp/m-static.exp: Likewise. --- gdb/testsuite/gdb.cp/anon-struct.exp | 25 ++++++++---- gdb/testsuite/gdb.cp/m-static.exp | 75 ++++++++++++++++++++++++------------ 2 files changed, 69 insertions(+), 31 deletions(-) diff --git a/gdb/testsuite/gdb.cp/anon-struct.exp b/gdb/testsuite/gdb.cp/anon-struct.exp index edab092..3446eb7 100644 --- a/gdb/testsuite/gdb.cp/anon-struct.exp +++ b/gdb/testsuite/gdb.cp/anon-struct.exp @@ -20,14 +20,25 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } return -1 } -gdb_test "ptype t::t" "type = void \\(t \\* const\\)" \ - "print type of t::t" +if { [istarget arm*-*-*] } { + gdb_test "ptype t::t" "type = struct t {\r\n C m;\r\n} \\*\\(t \\* const\\)" \ + "print type of t::t" +} else { + gdb_test "ptype t::t" "type = void \\(t \\* const\\)" \ + "print type of t::t" +} gdb_test "ptype X::t2" "type = struct X::t2 {\[\r\n \]*X::C2 m;\[\r\n \]*}" \ "print type of X::t2" -gdb_test "ptype X::t2::t2" "type = void \\(X::t2 \\* const\\)" \ - "print type of X::t2::t2" - -gdb_test "ptype t3::~t3" "type = void \\(t3 \\* const\\)" \ - "print type of t3::~t3" +if { [istarget arm*-*-*] } { + gdb_test "ptype X::t2::t2" "type = struct X::t2 {\r\n X::C2 m;\r\n} \\*\\(X::t2 \\* const\\)" \ + "print type of X::t2::t2" + gdb_test "ptype t3::~t3" "type = void \\*\\(t3 \\* const\\)" \ + "print type of t3::~t3" +} else { + gdb_test "ptype X::t2::t2" "type = void \\(X::t2 \\* const\\)" \ + "print type of X::t2::t2" + gdb_test "ptype t3::~t3" "type = void \\(t3 \\* const\\)" \ + "print type of t3::~t3" +} diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp index 65ec6a0..9b0e642 100644 --- a/gdb/testsuite/gdb.cp/m-static.exp +++ b/gdb/testsuite/gdb.cp/m-static.exp @@ -69,30 +69,57 @@ gdb_test "print test1.key2" "\\$\[0-9\]* = 77" "simple object, static long" # simple object, static enum gdb_test "print test1.value" "\\$\[0-9\]* = oriental" "simple object, static enum" -gdb_test "print test5.single_constructor" \ - { = {void \(single_constructor \* const\)} 0x[0-9a-f]+ } \ - "simple object instance, print constructor" -gdb_test "ptype test5.single_constructor" \ - {type = void \(single_constructor \* const\)} \ - "simple object instance, ptype constructor" -gdb_test "ptype single_constructor::single_constructor" \ - {type = void \(single_constructor \* const\)} \ - "simple object class, ptype constructor" - -gdb_test "print test1.~gnu_obj_1" \ - { = {void \(gnu_obj_1 \* const, int\)} 0x[0-9a-f]+ } \ - "simple object instance, print destructor" -gdb_test "ptype test1.~gnu_obj_1" \ - {type = void \(gnu_obj_1 \* const, int\)} \ - "simple object instance, ptype destructor" - -gdb_test "print test1.'~gnu_obj_1'" \ - { = {void \(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ } \ - "simple object instance, print quoted destructor" - -gdb_test "ptype gnu_obj_1::'~gnu_obj_1'" \ - {type = void \(gnu_obj_1 \* const\)} \ - "simple object class, ptype quoted destructor" +if { [istarget arm*-*-*] } { + gdb_test "print test5.single_constructor" \ + { = {single_constructor \*\(single_constructor \* const\)} 0x[0-9a-f]+ } \ + "simple object instance, print constructor" + gdb_test "ptype test5.single_constructor" \ + {type = class single_constructor {\r\n public:\r\n single_constructor\(void\);\r\n ~single_constructor\(int\);\r\n} \*\(single_constructor \* const\)} \ + "simple object instance, ptype constructor" + gdb_test "ptype single_constructor::single_constructor" \ + {type = class single_constructor {\r\n public:\r\n single_constructor\(void\);\r\n ~single_constructor\(int\);\r\n} \*\(single_constructor \* const\)} \ + "simple object class, ptype constructor" + + gdb_test "print test1.~gnu_obj_1" \ + { = {void \*\(gnu_obj_1 \* const, int\)} 0x[0-9a-f]+ } \ + "simple object instance, print destructor" + gdb_test "ptype test1.~gnu_obj_1" \ + {type = void \*\(gnu_obj_1 \* const, int\)} \ + "simple object instance, ptype destructor" + + gdb_test "print test1.'~gnu_obj_1'" \ + { = {void \*\(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ } \ + "simple object instance, print quoted destructor" + + gdb_test "ptype gnu_obj_1::'~gnu_obj_1'" \ + {type = void \*\(gnu_obj_1 \* const\)} \ + "simple object class, ptype quoted destructor" +} else { + gdb_test "print test5.single_constructor" \ + { = {void \(single_constructor \* const\)} 0x[0-9a-f]+ } \ + "simple object instance, print constructor" + gdb_test "ptype test5.single_constructor" \ + {type = void \(single_constructor \* const\)} \ + "simple object instance, ptype constructor" + gdb_test "ptype single_constructor::single_constructor" \ + {type = void \(single_constructor \* const\)} \ + "simple object class, ptype constructor" + + gdb_test "print test1.~gnu_obj_1" \ + { = {void \(gnu_obj_1 \* const, int\)} 0x[0-9a-f]+ } \ + "simple object instance, print destructor" + gdb_test "ptype test1.~gnu_obj_1" \ + {type = void \(gnu_obj_1 \* const, int\)} \ + "simple object instance, ptype destructor" + + gdb_test "print test1.'~gnu_obj_1'" \ + { = {void \(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ } \ + "simple object instance, print quoted destructor" + + gdb_test "ptype gnu_obj_1::'~gnu_obj_1'" \ + {type = void \(gnu_obj_1 \* const\)} \ + "simple object class, ptype quoted destructor" +} # Two.