From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GSwcECH8jGINGggAWB0awg (envelope-from ) for ; Tue, 24 May 2022 11:39:13 -0400 Received: by simark.ca (Postfix, from userid 112) id 357F81E220; Tue, 24 May 2022 11:39:13 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=JktH+l4g; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 49B201E00D for ; Tue, 24 May 2022 11:39:12 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ED6583835C23 for ; Tue, 24 May 2022 15:39:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED6583835C23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653406752; bh=TNHhnlRxpE9+XSR4/GVQZBhpIVq0gx0rxE/C2duUlKs=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=JktH+l4gJG8XjWfHl9XNz1ct3goD05IknXt9O5MWso9CrrNgMOjdC0VML+lQa4vnc Vw/Yk23VBkYcgmFnwz1LRJ8l+dBp+Loc9Kw0ZNHrU6VU3xeF3QuMEidACrN4x2mU0s flckIFnCY4rR2UxheLecevN7qCJYQyV9Xs+TdGPc= Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2058.outbound.protection.outlook.com [40.107.22.58]) by sourceware.org (Postfix) with ESMTPS id B2692383E839 for ; Tue, 24 May 2022 15:38:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B2692383E839 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=DYbJGiaN2v9I8jSsHxwRTNNSBb4lbDpvQuXgKSONa7o4um3rG6M2C3EwnUN5t74KHw6G6h+qe0wyVv8Sbm1UBE66BYA88gw2+UD0aoubgwRDlMztbOBCPOHKzgBLFPJDNmY9eOYVCij+pHIiWWNuHdQNAvnk0YbULflVyuZCPg/6Wreu0G2C0iXSzLU4BoPKEYHb+6VeAGBqgtjeIbYJqrmZ8Iv9ZzwswG+fYJU75QT+CNvR1MnhAm13gUyTBN4ef66YeAffgNJmy+Xozx4c5zgru4fpXqUMFIy0xTGZJNFclsF3h+7e5pwfGpbfNPOq8U2n3NOxeufVa4sjdoX/HA== 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=TNHhnlRxpE9+XSR4/GVQZBhpIVq0gx0rxE/C2duUlKs=; b=aAtyjxaltkFi525CwbbpjLNqVZv1QuTHXQ8a0Ytk3zPUthZA1NJoPP9JjZIDFa1hQeaToQ+Ap2viwuHV/X0zmPMC7PVseQhcwnFtFi444hERT/BQHScy9A5zhm/pUHh/c9VjR1XapssYa2AOvJi7BH1tVxp3Zhxi3fN4wF+Kp7kbQwPP8tlsUpGENHulOyQtj/RqsXXspvMJzRG1Mjw2fDjIJXOtnoSBFc2MPtH4KSJelC8cIdBbutqbxx1exnPOz4lWzZV16mJxJqrtbC039N87TJWb8aWwgs3w/aQlK8BiwOMz+lbhFQPF6L2xZqVjnY+IFyRJ7r3kAgNbjtZNNg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.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] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AS9PR07CA0033.eurprd07.prod.outlook.com (2603:10a6:20b:46b::19) by PR2PR08MB4651.eurprd08.prod.outlook.com (2603:10a6:101:1c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Tue, 24 May 2022 15:38:45 +0000 Received: from VE1EUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46b:cafe::42) by AS9PR07CA0033.outlook.office365.com (2603:10a6:20b:46b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.7 via Frontend Transport; Tue, 24 May 2022 15:38:45 +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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT020.mail.protection.outlook.com (10.152.18.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Tue, 24 May 2022 15:38:45 +0000 Received: ("Tessian outbound 42cead292588:v119"); Tue, 24 May 2022 15:38:45 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8c0b100543ced9db X-CR-MTA-TID: 64aa7808 Received: from e6fd3d861309.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BC37C8D4-5B74-43A1-971F-C2CEB09A2B85.1; Tue, 24 May 2022 15:38:39 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e6fd3d861309.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 24 May 2022 15:38:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MTi1W9+tLjjHZzQgoE8KHC5fnsTgIQ0bGTypgdaXTNZHiQYZvOw+g4TfM+XxVq51wuHmIyYX+F36hjiCqPA0juJY+r4P28B4o7VJ3YBQXN52Hrd8C3YstYPVu0eUtgzetrEGJN4uV3MPNFONztOSKa0JPSAfX2QsvgCrAl1FXHxHHdd8bf11K1Al4MMPkp3q6fbUf2pNLESASzcy6RjH5rIOFnvzydNh4rLjzHz5HQJo6r4sTZcdBSfIXarC5NYUJKffiydxqyWrmHBxIePR4eOfUDCtIvYTIK8tk5hb6t16dYa+b0e5dRAXXIOfcnH6cls6tflVQV40cTzkqMeMDw== 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=TNHhnlRxpE9+XSR4/GVQZBhpIVq0gx0rxE/C2duUlKs=; b=YbW+i7wxDo6k04Jc9feRy4BeWCArjev9PuUKCg9ckzFHv0M/4JWBZIrQ/mXVy9yx9TwlQKAdSiwi/EMiQv4PtJi/yM7Z6trWcyED9ze7sam2e2qAkNkbSRCqWKbADaNqgvaonV/mGDT6sxLau22PRZNpxyChJHBv7xsUdtnp/FIwfzY9GfGtHR1WgloI8tuUj9gmqHAyfqzXZYhydgOZ36RpyfDakO8lIEDXtK0hPlc9s3bs1S+E2Iz8CbR7oLq1Ug8xeKvDYalQPtVhXk42cihaysAAHSnQc4Ypsy3IVZec888fsqfHxQ/Tw0sxiZfxlSLGRLdjRg0JvQUhC9ewaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by VE1PR08MB5677.eurprd08.prod.outlook.com (2603:10a6:800:1ab::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Tue, 24 May 2022 15:38:36 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7080:6233:cf8f:a8a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7080:6233:cf8f:a8a6%7]) with mapi id 15.20.5273.023; Tue, 24 May 2022 15:38:36 +0000 Message-ID: <601f3b02-67a6-34f5-69d4-5e37e9cba277@arm.com> Date: Tue, 24 May 2022 16:38:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH][gdb/testsuite] Fix gdb.opt/clobbered-registers-O2.exp with clang Content-Language: en-US To: Tom de Vries , gdb-patches@sourceware.org References: <20220524140720.GA23626@delia.home> In-Reply-To: <20220524140720.GA23626@delia.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0423.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18b::14) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8715db68-ecc9-4efa-edf8-08da3d9b7d1b X-MS-TrafficTypeDiagnostic: VE1PR08MB5677:EE_|VE1EUR03FT020:EE_|PR2PR08MB4651: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: jIrUWGIsmg2bxIG1/5+j3gbRDwV/VBal9BIL3E89rnZ9DRDgJjiXm5rEcWRyc8PRoAv8/ke9bQwLz1dTpoFgUQEebIRhQpdnXh0sQlRzA9+JyZCLZE6dQfQQViVdmvofVBAjGlwYr/Z7o0HgHXx0QH8DNhPIgdBzrYdqOZIltzCcgaiq8iF8IbZeFNN3D1fgoVZ6F8TtSNdGvii2b+Or3YRM/4chVhcwTEzrE6d4DvJjizlsW/ugj2kOv6KaMM9RHBkvQ8QwKoBMcZP6r7MYkUV/4mNcMRfXCh5GJvQebTKJYTwTVVIGGurRV0N5DihEbj1Khcn3lzGT0ZQf0j3TSWmHs5xnKFfnWAu72CSeZhDPI7KaDE3L3hAUxfYup+OnqUsiF0tnpbPRL8DpSogSG4THXT75NceJJ0KRI2Ku54UWpIFu4vw56FViGO0wdI2NOdSsDjnx2N0i/L62DVTxVasiB0E7ocm/EDbRqp936yDccqnLncdSueCzrEL39J/bGZ07Lxisbqo2BUiqChl6/K6SJUdlITCbrQsnScSHLOb7ujQq/XOXaBz38gBrVvOFIhEiGkX0pWzzc03nYH+JhPVuAOzGahRv3h6f3z4MFsKljfOBkR6h615vpI8O/16bH/92ya+sT61DoRBfLhxW2DgarwrhH71gi9/hcfnYA4i33asZSQO76F12cITCLEdMVLZ1Qe6AUSS7MjpvFranIStaBZi+qcmdn+2gQldgXPINyEylf031USK3g7UNd3mJBseHcnEzCsr9ytyZv4zkIpei+YViOZ9cILX2GKYZBP0odC39OsHCnMOMdfsWe+nddfAJs40UzrMZhViCElzqVA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB3919.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(8676002)(84970400001)(83380400001)(6486002)(66556008)(66946007)(44832011)(508600001)(66476007)(316002)(8936002)(26005)(2616005)(186003)(6506007)(2906002)(36756003)(5660300002)(6512007)(38100700002)(31686004)(53546011)(86362001)(31696002)(2004002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5677 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 701e042b-257d-48d3-b0c6-08da3d9b779b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: etWwVVl4QsoorPAxOn5IovDGu3NDgVEZFwSDQMeE9tFRKCVT+iKRNpdzWmakajRLZLvi7M3udtZNHIS6Xuxe9U/EtaUKaJyDRM2K5hRv9cNZPW6jPyTUy0cwPiXoxwkGaehAOAd+uXOSE9/MeXm3sKBn7/Pk1mpfeYgLnl0i5gwXjSXdmBoQMEvfLfNovMSbSoSnZd7FwhLKASs73UcdASJlM8rslTsZXMWMhWNwjtZQzHnVqeAbKJwA0gX6slHpCm0QP0jDy8WGN5dqee5JkGT2AP8QYlTDKk2AOnK0GnT86kpBXggko+TzhHxT2KUxAofif7eK+5/QkSHvISDqu2YkcadM1NjugzQC28EmEgMc7+yZCYdXuCyenv7Jwd6htsV0Y1lS3fQkwbhp137d/ho/fLtYko4TytA3Z0MimtGgHqaqU63Bgpm//ZH8o4qpk0EyXvJpvEiwEcTQZSCRO9B8tj3PIzCgpNpDToyS73YO9ZL2DHDjRPE16hCV/ElnPpTLkg+ZdZd4u2QKzyLwsPhLvDmC8qxUdYk4jGAB6WX+g3NH6OyKT58X3EeyNPQZP0zZI46PY7Tgn/uB7tpaL7FsR9j9o9teGem8WvwhV1qHprCJOm45gTbzPwbkrTZMzHscC2VaOMcyQe1DDM/jAILOGrU/PNPWLrNmjnDZ8IG9Hw2ci6Y3UfgzOxe3uEwDvn9uMkBqoeBemM7L30zwq7HBbxcUjppNVNMbqQnZI55t1hmJdqsIwGOPw1kjsppD8uWZm1ApGBrO6Zn9sEHCIA9/evLJe1XP44/SOoFi3BclpeTsXNuKsoVH1iUkFQ2H 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)(336012)(44832011)(70206006)(356005)(36860700001)(81166007)(70586007)(8676002)(84970400001)(2906002)(5660300002)(8936002)(40460700003)(53546011)(6486002)(82310400005)(508600001)(86362001)(316002)(31686004)(47076005)(186003)(31696002)(6512007)(26005)(2616005)(6506007)(83380400001)(36756003)(2004002)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2022 15:38:45.3147 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8715db68-ecc9-4efa-edf8-08da3d9b7d1b 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: VE1EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4651 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Luis Machado via Gdb-patches Reply-To: Luis Machado Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 5/24/22 15:07, Tom de Vries via Gdb-patches wrote: > Hi, > > When running test-case gdb.opt/clobbered-registers-O2.exp with clang 12.0.1, I > get: > ... > (gdb) run ^M > Starting program: clobbered-registers-O2 ^M > ^M > Program received signal SIGSEGV, Segmentation fault.^M > gen_movsd (operand0=, operand1=) at \ > clobbered-registers-O2.c:31^M > 31 return *start_sequence(operand0, operand1);^M > (gdb) FAIL: gdb.opt/clobbered-registers-O2.exp: runto: run to start_sequence > ... > > The problem is that the breakpoint in start_sequence doesn't trigger, because: > - the call to start_sequence in gen_movsd is optimized away, despite the > __attribute__((noinline)), so the actual function start_sequence doesn't get > called, and > - the debug info doesn't contain inlined function info, so there's only one > breakpoint location. > > Adding noclone and noipa alongside the noinline attribute doesn't fix this. > > Adding the clang-specific attribute optnone in start_sequence does, but since > it inhibits all optimization, that's not a preferred solution in a gdb.opt > test-case, and it would work only for clang and not other compilers that > possibly have the same issue. > > Fix this by moving functions start_sequence and gen_movsd into their own > files, as a way of trying harder to enforce noinline/noipa/noclone. > > Tested on x86_64-linux. > > Any comments? > > Thanks, > - Tom > > [gdb/testsuite] Fix gdb.opt/clobbered-registers-O2.exp with clang > > --- > gdb/testsuite/gdb.opt/clobbered-registers-O2-2.c | 24 ++++++++++++++++++++++++ > gdb/testsuite/gdb.opt/clobbered-registers-O2-3.c | 22 ++++++++++++++++++++++ > gdb/testsuite/gdb.opt/clobbered-registers-O2.c | 16 +--------------- > gdb/testsuite/gdb.opt/clobbered-registers-O2.exp | 5 +++-- > 4 files changed, 50 insertions(+), 17 deletions(-) > > diff --git a/gdb/testsuite/gdb.opt/clobbered-registers-O2-2.c b/gdb/testsuite/gdb.opt/clobbered-registers-O2-2.c > new file mode 100644 > index 00000000000..c709c043677 > --- /dev/null > +++ b/gdb/testsuite/gdb.opt/clobbered-registers-O2-2.c > @@ -0,0 +1,24 @@ > +/* This file is part of GDB, the GNU debugger. > + > + Copyright 2007-2022 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +extern unsigned *start_sequence (unsigned *x, unsigned *y); > + > +unsigned > +gen_movsd (unsigned *operand0, unsigned *operand1) > +{ > + return *start_sequence (operand0, operand1); > +} > diff --git a/gdb/testsuite/gdb.opt/clobbered-registers-O2-3.c b/gdb/testsuite/gdb.opt/clobbered-registers-O2-3.c > new file mode 100644 > index 00000000000..664d5f20d24 > --- /dev/null > +++ b/gdb/testsuite/gdb.opt/clobbered-registers-O2-3.c > @@ -0,0 +1,22 @@ > +/* This file is part of GDB, the GNU debugger. > + > + Copyright 2007-2022 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +unsigned * > +start_sequence (unsigned *x, unsigned *y) > +{ > + return (unsigned *)0xdeadbeef; > +} > diff --git a/gdb/testsuite/gdb.opt/clobbered-registers-O2.c b/gdb/testsuite/gdb.opt/clobbered-registers-O2.c > index 83cf2267d1e..8201d99763f 100644 > --- a/gdb/testsuite/gdb.opt/clobbered-registers-O2.c > +++ b/gdb/testsuite/gdb.opt/clobbered-registers-O2.c > @@ -15,21 +15,7 @@ > You should have received a copy of the GNU General Public License > along with this program. If not, see . */ > > -#ifndef __GNUC__ > -#define __attribute__(x) > -#endif > - > -unsigned * __attribute__((noinline)) > -start_sequence (unsigned * x, unsigned * y) > -{ > - return (unsigned *)0xdeadbeef; > -}; > - > -unsigned __attribute__((noinline)) > -gen_movsd (unsigned * operand0, unsigned * operand1) > -{ > - return *start_sequence(operand0, operand1); > -} > +extern unsigned gen_movsd (unsigned *operand0, unsigned *operand1); > > int main(void) > { > diff --git a/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp b/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp > index e01f445688d..b38f3642840 100644 > --- a/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp > +++ b/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp > @@ -18,7 +18,7 @@ > # Test displaying call clobbered registers in optimized binaries. > # GDB should not show incorrect values. > > -standard_testfile > +standard_testfile .c -2.c -3.c > > # What compiler are we using? > # > @@ -26,7 +26,8 @@ if [get_compiler_info] { > return -1 > } > > -if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ > +if {[prepare_for_testing "failed to prepare" $testfile \ > + [list $srcfile $srcfile2 $srcfile3] \ > {debug optimize=-O2 nowarnings}]} { > return -1 > } As mentioned in the other thread, this test can be a bit fragile. If the above works for clang, I'm fine with it. Thanks for getting this addressed.