From patchwork Fri May 13 16:35:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 53965 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 31CF23836024 for ; Fri, 13 May 2022 16:37:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31CF23836024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652459865; bh=rW0p1pDbw+x9MpGU2qf3wtNMbTIUoQHm6xbPVw83juo=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dg7raTgBZNwuPqFHtkXSo1zSFmgvFzK+ISUdIxiBOkRuSOHTHu7iBR1ePO58drJwh doF3M7suLCkFVitAkU9QP+0NZdz1QGhC6hx0OzeuzV9itRRF1lvjdkFmJ7nTzqomTo 1izl1Qeii7DxGRKjtqMmLa/xN/5ipledVPHM99bI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) by sourceware.org (Postfix) with ESMTPS id 43329383D82E for ; Fri, 13 May 2022 16:36:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 43329383D82E ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=RW7lUvM0A+EevokOyVZ6d/4vfJnQwBds8XxkoEI+gT84GLJKYCy3bJrPfXsaJhdePOUtvQE5c7+sFtGmcz6HXppGTjBAP20mk86Sxi9Dzr8Q/LR+pXtnzqIjQb1WsJJaXIDTW/89/i3Q0XR6TvSj2xhwRJHv8UHaivscwvVpijVLY61mJPYKhICOo41zBfFR45mapJu/8hd5vYqP1vob5+UEl0Bx2X97HvRbPvq9CtopwJwmr8hQsb6tgBfeapWgV274pGdzjKWKlmFfZTFUahV5GxlmqKxF/2bbj6F5Nzi5GY/b2+TkVr8h3FvziswdDCdnSfKPkTbzfhTOT7DE0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rW0p1pDbw+x9MpGU2qf3wtNMbTIUoQHm6xbPVw83juo=; b=RLvhsWauE58GcOdcsRh+8nFIb8wpYKJJCuFVAwvibdp6Vj+o8nuGmz9CuwL15rP7A5q37tdNKR6eXPV7egjbtkvmTQBTLuKNCxYNMUY7lNzodJAYSgG26hRLesLkGRlOc2YQV72+XKwNu7OuWr/LQJY86tpEIAhqqQZU5/czUnD/j5BJpxF3vROkxlSoN8AEsN2mEZKYobGZaE98dVHGogvycnW5aFJ6PtRW3/BVft2ZaWoRmfP4nba1XGwvB+W4wAa/HQV8he+t9DBTN1PTNsKmhzXclBNoQdOihfREMuSafkgpM8CfCzsQodw4+uqjcbpAblX0jiy9xNxu+NDSmw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AM6PR04CA0026.eurprd04.prod.outlook.com (2603:10a6:20b:92::39) by DB9PR08MB6602.eurprd08.prod.outlook.com (2603:10a6:10:23c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.14; Fri, 13 May 2022 16:36:03 +0000 Received: from AM5EUR03FT018.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:92:cafe::11) by AM6PR04CA0026.outlook.office365.com (2603:10a6:20b:92::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.15 via Frontend Transport; Fri, 13 May 2022 16:36:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT018.mail.protection.outlook.com (10.152.16.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13 via Frontend Transport; Fri, 13 May 2022 16:36:02 +0000 Received: ("Tessian outbound 07c1c99345b0:v119"); Fri, 13 May 2022 16:36:02 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1ea087bb69ef8bde X-CR-MTA-TID: 64aa7808 Received: from 72b0cd2594be.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 82456C84-BA4F-4BA6-A2DD-88DFD231C372.1; Fri, 13 May 2022 16:35:56 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 72b0cd2594be.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 13 May 2022 16:35:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=euPT95iZnVojO0O0BPOrvggZ2ycPWh3fM+jaE0ZZikn7p49o8VL90VOUwTOV/ZAGdJJS2qALeBR9NgvaJTPMnsE/B9XEHTd/XLRQ7BUQ+dzhaGXNWyHqbKvazJzgoq4Nq1z6rPHU4oAzLiWE9218UH+UwgWt/NGhu8BHUSbCB7YnaF+1iHpD8iJXpN3k8tPqVFln6vkxeTly9CJDGPPTPvnI16cgLCW6GsPZxLDmFMJIU6zGwr1fZQbCH8+C6EOlm4Eku1NJIFWz/is0eragtouBuWEEcuDvLtw4qYK6zk4dh4ps7D4/6rdqKBLVqxbQESSY6Mu1hlISgq1N589DaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rW0p1pDbw+x9MpGU2qf3wtNMbTIUoQHm6xbPVw83juo=; b=Sbrq/F6Bpr1ErikTZx2ibM1wDTMEdw0EzWs0QrQAgk0mtsa2rWBTD9S7TW1xakPvHh8fYYu/Q6SZ6zvnD74Nf7Vl2lPaU+oQZ9farBUJr77jXkRMj5A3HO5CRcS06DGyIJ5AXDOh2PpnLqIGhA6eYzKYMS69wdPza9KD9Qhqa0Wql7oF3qHeYMEHnqHhQQuNqOMwDLQ60b2+UXe6A4RzLbLZZ3j/g4v7nxpaP937338zduSLwJsQcFNg2uxGM+vE8xm0JxPxoxPa/FxLsuMku79TduTqJzMVW2/Qsz+auP/enS5/uQrcOPeZMpF2cpJ4KlQ97aWXJHzfKpsuAQcQEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from AM6P195CA0077.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::18) by AS8PR08MB6581.eurprd08.prod.outlook.com (2603:10a6:20b:33a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.14; Fri, 13 May 2022 16:35:50 +0000 Received: from AM5EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:86:cafe::5d) by AM6P195CA0077.outlook.office365.com (2603:10a6:209:86::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13 via Frontend Transport; Fri, 13 May 2022 16:35:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT031.mail.protection.outlook.com (10.152.16.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5250.13 via Frontend Transport; Fri, 13 May 2022 16:35:50 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 13 May 2022 16:35:56 +0000 Received: from e129018.arm.com (10.57.33.200) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Fri, 13 May 2022 16:35:56 +0000 To: Subject: [PATCH v2 08/10] testsuite: Add C++ unwinding tests with Decimal Floating-Point Date: Fri, 13 May 2022 18:35:53 +0200 Message-ID: <20220513163553.317619-1-christophe.lyon@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220509143507.239804-9-christophe.lyon@arm.com> References: <20220509143507.239804-9-christophe.lyon@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: f87f4832-e2f6-4099-c543-08da34feab70 X-MS-TrafficTypeDiagnostic: AS8PR08MB6581:EE_|AM5EUR03FT018:EE_|DB9PR08MB6602:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: scRpLuEOLhS+VTdwqI3dTxk7ekTG7fIeMj88xGNc8bjADBc//GwT9uZnZgnFwq5sMh0dgBWpendGowdiqMMhu6XBoXySvdkdi9xagtuXUTsZvv9KMoSyIP1f+Qv9xzNEsU6rxDGs/5zr2JXcdXbTjDywfF8mQfS12pK8EgZMgZ9EVV5OPKKgrD3GPsPlanExfYc95hE/FHbqLfI/sm/53kQboZ6k+gRkIic7sm6iIAbnoGAaIBA1cvom3UvvvajZ0HOsS3XaHt2vWpbMNLanuKbqKhmYowNPVX2apgfj35iDMit+becYdIAf3mm7KLRfk7KL4bVL3La6gEmmupm1HJ74AK2z8ZWkKIrUKxzqYvfpgIBUSR0CO8+LS6uHajfFX+SeGmnU9CH1ATnULYpK6CaPqzEf/1f1wAiYgl6rL8OmJuBjPLRFR6+pn9sY9Xe+Yzsu/MfWNixzh1qVZ1wUjA76YsRyunyBVoUya/Vxi6Vokvcd4Y3xmtQMaFV0C4whqKZRv0JaKqoVDleCkA5W2sy+CZYmF3I17WtX2gj1zS4SCqf79htzIPnic8TWWToVs5SSojcQ6O5ukN7LqsxAAeq2L0nM1HNiZjsCsFi3byNyobdVJ2t5zmJcUil6rBkuyitYqqMxR+OOBkzwVR3/ysDCXKeuoMttPfL+R3M75s+xXMRfU3SBOzC8k77XQZbQTqY5hPBZIGNOnNtiYzy9dA== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(86362001)(26005)(2616005)(82310400005)(6666004)(7696005)(83380400001)(40460700003)(1076003)(336012)(426003)(47076005)(508600001)(186003)(36860700001)(70206006)(8676002)(4326008)(8936002)(70586007)(316002)(6916009)(44832011)(81166007)(5660300002)(356005)(2906002)(36756003)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6581 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 913b6794-54a9-4cb3-6b9b-08da34fea426 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 27+9OI809gKiQMz5/b9nqpeCErO1Y9hI+z8Q08vIJ0zCZZg7eQeVMCVOEQMOqw0mxpbXfK6dTVh0jMqifzq9OY/2+gIFjfUcpMv9hPXi14sRnG4M0zH4ra9l4ztU0hfkamSKV72INp73J3Q4iKb+DYUsWx5E2qeYaQrTOTrOCeUnRh5+Cu+x0yp529h3Xa2w9mq52xJI/ECVUFT5jnmm+Pz0LyL91IBxHVTsG0A+aE8WseK1w9jfZu1PWOKWcj8eRuGsLdCVc9X2f0SCxJe6qpNxxCBo3TtvcMUfA+8RtXMOfs/N+zwcKvL6XXekVACH43GDRSgzjqRDsw7125F0pWMMqrz4VzeY+u5xiLHZ5KEW3R1/0jIlTuZEWIL/f5WBMjN1vuhCzArjm6E6GKZhLaeE5cNFOG99mNZ/r0Hi01RdysVUlDvhwRxe7Ew4naRsDwkxe6+4VI2hGquUTDzz0ghf6LbxrV2kyaMOoxjEtlyeplxUeScx0dyaE40uktk+lo7QFOZveXVIQ5XjhV+V2MEJsQ7outIfXCfG1GSpoMkzOCryPlQWM+zhyNdHoa4EccyyxlUaMzW4OEI/ISFhBeMuNz2ZztjitzBx0tzYT2p1os6obfz1Wm0CpDdJ8N0gV3VGlr5zfAxC2NN9jrx6hNSTozZH6O3nCaFbsp77SemWJYlMNQeNzDHlUyfGZU3/ X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(5660300002)(8936002)(44832011)(2906002)(81166007)(316002)(6916009)(4326008)(8676002)(70206006)(70586007)(83380400001)(1076003)(186003)(7696005)(26005)(2616005)(508600001)(336012)(47076005)(426003)(40460700003)(6666004)(36860700001)(82310400005)(86362001)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2022 16:36:02.8353 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f87f4832-e2f6-4099-c543-08da34feab70 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6602 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Christophe Lyon via Gcc-patches From: Christophe Lyon Reply-To: Christophe Lyon Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" These tests exercise exception handling with Decimal Floating-Point type. dfp-1.C and dfp-2.C check that thrown objects of such types are properly caught, whether when using C++ classes (decimalXX) or via GCC mode attributes. dfp-saves-aarch64.C checks that such objects are properly restored, and has to use the mode attribute trick because objects of decimalXX class type cannot be assigned to a register variable. 2022-05-03 Christophe Lyon gcc/testsuite/ * g++.dg/eh/dfp-1.C: New test. * g++.dg/eh/dfp-2.C: New test. * g++.dg/eh/dfp-saves-aarch64.C: New test. --- gcc/testsuite/g++.dg/eh/dfp-1.C | 54 +++++++++++++++++++++ gcc/testsuite/g++.dg/eh/dfp-2.C | 54 +++++++++++++++++++++ gcc/testsuite/g++.dg/eh/dfp-saves-aarch64.C | 49 +++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 gcc/testsuite/g++.dg/eh/dfp-1.C create mode 100644 gcc/testsuite/g++.dg/eh/dfp-2.C create mode 100644 gcc/testsuite/g++.dg/eh/dfp-saves-aarch64.C diff --git a/gcc/testsuite/g++.dg/eh/dfp-1.C b/gcc/testsuite/g++.dg/eh/dfp-1.C new file mode 100644 index 00000000000..b0da13a4cc5 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/dfp-1.C @@ -0,0 +1,54 @@ +// { dg-do run } +// { dg-require-effective-target dfp } + +extern "C" void abort (); + +#include + +using namespace std::decimal; + +int +foo (double fp) +{ + if (fp < 32.0) + throw (decimal32)32; + if (fp < 64.0) + throw (decimal64)64; + if (fp < 128.0) + throw (decimal128)128; + return 0; +} + +int bar (double fp) +{ + try + { + foo (fp); + abort (); + } + catch (decimal32 df) + { + if (df != (decimal32)32) + abort (); + } + catch (decimal64 dd) + { + if (dd != (decimal64)64) + abort (); + } + catch (decimal128 dl) + { + if (dl != (decimal128)128) + abort (); + } + return 0; +} + +int +main () +{ + bar (10.0); + bar (20.0); + bar (100.0); + return 0; +} diff --git a/gcc/testsuite/g++.dg/eh/dfp-2.C b/gcc/testsuite/g++.dg/eh/dfp-2.C new file mode 100644 index 00000000000..aff0e03d1d9 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/dfp-2.C @@ -0,0 +1,54 @@ +// { dg-do run } +// { dg-require-effective-target dfp } + +extern "C" void abort (); + +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +int +foo (double fp) +{ + if (fp < 32.0) + throw (dec32)32; + if (fp < 64.0) + throw (dec64)64; + if (fp < 128.0) + throw (dec128)128; + return 0; +} + +int bar (double fp) +{ + try + { + foo (fp); + abort (); + } + catch (dec32 df) + { + if (df != (dec32)32) + abort (); + } + catch (dec64 dd) + { + if (dd != (dec64)64) + abort (); + } + catch (dec128 dl) + { + if (dl != (dec128)128) + abort (); + } + return 0; +} + +int +main () +{ + bar (10.0); + bar (20.0); + bar (100.0); + return 0; +} diff --git a/gcc/testsuite/g++.dg/eh/dfp-saves-aarch64.C b/gcc/testsuite/g++.dg/eh/dfp-saves-aarch64.C new file mode 100644 index 00000000000..79f6697dd10 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/dfp-saves-aarch64.C @@ -0,0 +1,49 @@ +// { dg-do run { target aarch64*-*-* } } +// { dg-require-effective-target dfp } + +/* Test unwinding of AArch64 register saves. */ +/* We cannot use #include because it defines + decimal* types as classes, which we cannot be assigned to register + variables. Hence the use the mode attribute trick. */ + +#ifdef __aarch64__ + +typedef float dec64 __attribute__((mode(DD))); + +extern "C" void abort (void); +extern "C" void exit (int); + +void +foo (void) +{ + register dec64 v10 asm("v10") = 0; + register dec64 v11 asm("v11") = 1; + register dec64 v12 asm("v12") = 2; + register dec64 v13 asm("v13") = 3; + asm volatile ("" : "+w" (v10), "+w" (v11), "+w" (v12), "+w" (v13)); + throw ""; +} + +int +main (void) +{ + register dec64 v10 asm("v10") = 10; + register dec64 v11 asm("v11") = 11; + register dec64 v12 asm("v12") = 12; + register dec64 v13 asm("v13") = 13; + asm volatile ("" : "+w" (v10), "+w" (v11), "+w" (v12), "+w" (v13)); + try { + foo (); + } catch (...) { + asm volatile ("" : "+w" (v10), "+w" (v11), "+w" (v12), "+w" (v13)); + if (v10 != 10 || v11 != 11 || v12 != 12 || v13 != 13) + abort (); + } + exit (0); +} +#else +int +main (void) +{ +} +#endif