From patchwork Fri May 13 17:52:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 53971 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 BF272396E029 for ; Fri, 13 May 2022 17:59:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF272396E029 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652464788; bh=uPIIt8fbrfkkrl9egjUN/lKOntq3EiY5fUm83yexoWM=; 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=h2O0UUvZnBj2FhiYB7/jW1wCAM+U558b28oGGdLTFVnPSF7MoBqQQvSUYjaRlp2r7 tBVB0Yr5qPHZngXxgEaloAXbEf85eYOoZ0syMjGSuMCjvCGVO3nZoV8hvk5KIbckVr EeyAAjrsbxYx9BE/kz1Il8SMSuVDEmcE99Dl0I0s= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70082.outbound.protection.outlook.com [40.107.7.82]) by sourceware.org (Postfix) with ESMTPS id 2AD59396D81A for ; Fri, 13 May 2022 17:52:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2AD59396D81A ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Y2L06lCTqIK4ywmNNOFa4/Iq1QmR5PFAajGs2uLuLtqu0KQsw45DSKPEvvbQ0aFecqK9q+RSK/HkM0zM92OtfvMosYo84Ka9XQ8sxnoUDQ1fHtCKox+ck0AlIHCjhSFFGkJgyIEB7RvjxFc94ioKhJiCMBiXF2z76iFSD0Yc2PzdQ93nEv5b8sW5iwRO14+iN1LAgHmRsCUyLAkZCvywhZC0FS3Tae8alqNrZxzQCvOdwaAn0413K++4tfYAw+sNEqSahcdcA37VdSXL+ppL+gWV+9c80DI9UT7GYlFF39S00njJS4j1TxafKlJvoV7j+3mD+2Fou6irF4aVCmwuJw== 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=uPIIt8fbrfkkrl9egjUN/lKOntq3EiY5fUm83yexoWM=; b=Gi5ioSK5tGMOnqqmtq4O38Lw+K9OlKiSudSx1ny1jgzWUi2cocWdl8w0ioKHQpITg2T4p3h/84qNUllL309Xec5bOaVXLAwyagMSrUyvnGIoUnro/mlLMBos10ZAEkrxggYGdDsmXY2MXNbxldu0vxwUhQKFk0HKPe5B4gj2xR47lZ6MpkPb/FXDvr1BpWiGp9qJ0iQHSthNQYd5YblgxU3Vl4Wmctq8SFCACiWUC5Ur+GpmfyjIPeGzFx8g3a3oQoOQ1oAOIi3sB+h27P32ytYKoVxDaGgCaKW+6FRugJrZgXTYha7zPJsF42x6IXi9uSfybH2GHAAllh+EUFnSng== 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 DB9PR02CA0018.eurprd02.prod.outlook.com (2603:10a6:10:1d9::23) by DBBPR08MB4442.eurprd08.prod.outlook.com (2603:10a6:10:c9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.18; Fri, 13 May 2022 17:52:33 +0000 Received: from DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1d9:cafe::d) by DB9PR02CA0018.outlook.office365.com (2603:10a6:10:1d9::23) 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 17:52:33 +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 DBAEUR03FT059.mail.protection.outlook.com (100.127.142.102) 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 17:52:33 +0000 Received: ("Tessian outbound 3314dea8c23c:v119"); Fri, 13 May 2022 17:52:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ba8bcb0b96f88506 X-CR-MTA-TID: 64aa7808 Received: from 64c9a9a95790.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F78F94E3-89B7-4582-BCF5-8B757CAFAFBF.1; Fri, 13 May 2022 17:52:26 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 64c9a9a95790.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 13 May 2022 17:52:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H10TN6nDVOop7bnq/FmgY3P0e039OMZvr3c3gEDODVHK+2g5JCauHzVh0fGP/DS0i5EmHqt6XhFEqzZsqUZkrCgTXDKOPDSERdnyzhYPbBssf2F/8Jr4TsMEdH81b1O84x5q3fHzYkplOt9J2hCp9nlQb4J+Yxnkc/vkJlT6L/oQ347BxNJpGWE8ry+Dpsi2Dgr+Rv0tRXPmisSyxEblSgxMW7PARs/zZQVbaSDnIg6+WTl24jLsXyqaEv1fKSXy8yrEHCovklh4LU2zaZCUNriCG7yS2xjOiLbDfD254RsYlr0N5fwoipTG+4viYRcSTArm5Ktx8Gu6sFC8pwUa8w== 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=uPIIt8fbrfkkrl9egjUN/lKOntq3EiY5fUm83yexoWM=; b=caUNRrlMx5U7h85SmMYy+sXaRdmfkvG3XovDu5ppzEeKNZ0Ex4FGbbqZUg1O2lDnsfwbwAbXi8Qg+KCh2ppT0fLVOPUBmMkUrRSiPvy130RD2cwS3mdn8Gfs90C/OKZUF7hbaieB43d5hEXFDkFQ0tW/KmRtN5S/CUQIDFZaSq1EpEtFWZXRRynL5AzxF5x1emVJA087uDAUNYOpJ/oNVi5DcoSDYvvWB/zznlM74lnL2IUdk1eeB0GyZypVIF+ePGb3l/pYbSdz2U4BTmySvy9VPJH/v3EyAB9FRPeWSQUUa0CUh0tjph8++OqzU1EbAjK5NYBkz6Bsdr5xWg61fQ== 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 AS9PR06CA0400.eurprd06.prod.outlook.com (2603:10a6:20b:461::29) by AM6PR08MB4676.eurprd08.prod.outlook.com (2603:10a6:20b:d0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13; Fri, 13 May 2022 17:52:25 +0000 Received: from VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:461:cafe::25) by AS9PR06CA0400.outlook.office365.com (2603:10a6:20b:461::29) 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 17:52:24 +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 VE1EUR03FT044.mail.protection.outlook.com (10.152.19.106) 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 17:52:24 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) 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 17:52:29 +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 17:52:29 +0000 To: Subject: [PATCH v2 08/10] testsuite: Add C++ unwinding tests with Decimal Floating-Point Date: Fri, 13 May 2022 19:52:27 +0200 Message-ID: <20220513175227.356349-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: 1113f89a-63fa-4bc0-5d59-08da35095b89 X-MS-TrafficTypeDiagnostic: AM6PR08MB4676:EE_|DBAEUR03FT059:EE_|DBBPR08MB4442: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: nZs228v1GSeyr2jwyPlOmKIR7FIcHTtSMYoiuxHKUFtC10EiSksvNGoghtW3EMXlY5hL4bVBBi2Ykt2nG4B4IsovBKo3ZXp167VzAYFKUFPf6/7Nm0TT7n4EcSxcKG3T0hlkiONdDFMp1YeWNOfsaosKChSKbkLLxJDSbKTfmZceoDEczqnNlgsxQdoK+lwz+HiZg11S7hhFOakm1mrJDejKaLlLAXva+m9vc4mzVRY9WMzpOsyMilV35VJu/+MTEIgrnpez+9sPHbwbXfkJTKfTFhOPL2yBIYw6Af27qtANtk1R5XFuMTffk+v5+E1Z6q5xeBgBBftm/gJ+lTcnXyWVP4ZqPpiSWpJI9FcjMRjBruOYZX/+BrlFwA8FaKYanP5M/yVoo74UbHOawnI8GQXSjXRJIilH5EhKmSdKOjolrvmmZyC20j5Ucidvu2VYyyH2t9wIy0CxhARmE91j/B2ISac7UVoZfxumzI108HQJOxw3AHsEvJbGotrgsKsdQ5+UmyRiJCBE7Q2bs+ZOr5EgajVIIvjIrcvBh9W7gfNXYluY+xEM5zlB2oe7KmLCiwI1b8iRLGVq83GSD27/xapRF3hLHDJEo57RJtrVwz4no81h0DTuPE8iGbP5XFQxKW9Oy3WWBy5eMRTr5LFgQaYJ6IDZijQrX4sM6WAeySsxxkxxLyTEqfY0sGaxcInaRkaFDs0UaIWQ/LsRtmrCug== 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)(2616005)(86362001)(7696005)(356005)(81166007)(186003)(2906002)(4326008)(36756003)(8676002)(70206006)(70586007)(40460700003)(5660300002)(508600001)(47076005)(44832011)(426003)(8936002)(336012)(26005)(82310400005)(36860700001)(1076003)(6916009)(83380400001)(316002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4676 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a1dca0d0-810a-4a84-6cd8-08da35095659 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4dGoSsBTePXS09kWOfbOUJYubub0gJrn2wW2nscXDr96eolcL8G6tRtLo9+jvrTBenho15gzZ92LjmpWWBAUghEIdufUTylHbzdB+4F8NpmFiAu2xuBk8zDRYYM0/o612E4BF0KFq07DsKRluAJ9BFEzmN4xyfphjYzsQTwaYhptdjmzQsJ3QppP0xF4qHykNP5I7q7LAVnxjy0c2CUBF3YVKgRazh/D8d3bh/8MV6H25W8S9U75dcEvQ8lAcsu+BOzNDJ85NxvxSr6C5XuCEGWC8ipW5etRsAAI9rVDSxF48rDi9G2NNGxUNHj/vWLM0m4v9iKJmKDAxd1obslOmg5z4pUD8n+xquliUoKzsZx4rH5nKZYuuMbWNau50gEAuWJTOdGTA9LM2O6C7wR7ee1Mew23GxbOqTtGZe5C2bBNN27VtPIj+8HTzVZQ7/CmJvVjpitI8t2e3pKqzsSeu5UjV2awvUeCvhx/6BDMNWaQMAQtGJwcQrZn2a/C3G5DHQhiQI+0/3JcMy/CAq5Gg9Fr4ggGycy7L0ZGAfjUAi67W/ySDS7WHOwbn54WKgvv+Ha08MsuBH3UgItEfTAN+4YNBpXDpBdlFNzUI08VO1q6q4W3jnjgJwkxT91gYroN6cVfx9pTEyUhk/5XSlVqmeCbGurSBuZUu5ZVEkZ1xp/40KK7kqOswYmy6hI+xR4y 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)(46966006)(40470700004)(7696005)(426003)(82310400005)(47076005)(336012)(44832011)(26005)(5660300002)(40460700003)(508600001)(186003)(1076003)(8676002)(2616005)(83380400001)(36860700001)(8936002)(4326008)(2906002)(316002)(36756003)(6916009)(86362001)(81166007)(70206006)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2022 17:52:33.2897 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1113f89a-63fa-4bc0-5d59-08da35095b89 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: DBAEUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4442 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..06203410500 --- /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 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