From patchwork Mon Jan 15 11:26:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 84099 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 1F0123857715 for ; Mon, 15 Jan 2024 11:43:38 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2047.outbound.protection.outlook.com [40.107.15.47]) by sourceware.org (Postfix) with ESMTPS id 471EC3858D20 for ; Mon, 15 Jan 2024 11:42:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 471EC3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 471EC3858D20 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.15.47 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705318961; cv=pass; b=lZdUXHzbHuxMkQb5syMDk5lVmER08PqE9NgtSHuNMVBTIQb3xtiPL+AUqzhhmnALjtFAU9WiLreYjJEWRauo0caKt2wz/nzPZTU2GlNN/NJ9VKOyuBxQdCsDvm4c4cUowYo7JVyKsV39irKzwZUV1oxCl7ufF2Q1g++DWHBVpvE= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705318961; c=relaxed/simple; bh=j3Pf7aeClS5mowkocGOtyFfAN3tnNtlCqGhnPuYSj3M=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=T1zkEyK4FGAuaU/yvFzYDiuzPr7Qbc62K780Lnc9KxZcPrOn8EumsV+C20qb5RsGLsWrveqdAK3k2Cc9ndbLYOW87w2UWNoUAH9Jgf3ZtUQWJoIxlcpGOtmRz9gRlf5ngNQofhAFldLQixGrnZUPwOi4qAyu7AgoVn+1S0U9vio= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=K+1+kjkEgOnF/vcnjtGx/uOD8uZTq32VvqBghoavaV7vhMz7TDVUyAEy/9HL82Dg/skE3MyHQeSOxqPtB2j6A2x4kzOexGoEu4/cSdy5U0A18zKIFTP/Bn7bjiHxebUlFSFYA66rQAH8BS5leHNHcjllmEUKLgdKxFbTf0NR9QRacm+JSyKongPujrZvRNqkTsFHasEz46+mpDdvIJyDk5GBVfVhtiqGHT41w+uHOjZX7zpD3YEJn1sQ05IPPWjxm6GKxOf9TvAgvDqQ2S5sHT1c61AXgeEt7VpWRu4AOA0yvuWQLv/a4rWMvppZIJMvafTq2xq95VcVJF1f85KXaQ== 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=7PbyILrqzb3ZIeWAdhjIerbLMNs3/eNpCtI0elVzILA=; b=BtyxdPFv4pImm8fISxRMpaYYnnwtEtrfYy5WApPDBxh4+N7gRVpwR1dREui/T6LsH4XvnBE50Ka4jGVmKDpbJARmA/+TBmPnqLAvK74WQeK+tPH1t2bnZsmmndOVWzBFsQZx0sw+63e6/uR9a3B8Cc3lyQp+iUmvPFSy1X0EsvHZrbHiR8QuUrRTn82VGkBWE2SyDsRJXNxsWvZgXLqVIOxdxLrwBj265s+kg/EPMDoLiYgFvx9+V7qxVmnMkko5c6Cpy7QH3+RlOKBggGX88sJQV6kzMrjZETtH0uhPQUXj00w44IETIz37sTLZihBDlAQKqD1S5emWH+vClb7lQw== 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] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7PbyILrqzb3ZIeWAdhjIerbLMNs3/eNpCtI0elVzILA=; b=2VgkJG5HhYXk2Um+RdaOvQI6L5l1JWsYBgj/fkLwZg1UvE0XMa8MZzKAYuXKw4sz0a+Gb3k4Jcuoc1NRKsNLbq4jkua1GoI50JGOq3vkDgMOFZpLRK74qJdBLL36E0ImvBkyNhgqqn5zqK1F7WP1RbgdFQAqGBrfedd7tP4jvXM= Received: from AS8P251CA0012.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:2f2::33) by DU5PR08MB10609.eurprd08.prod.outlook.com (2603:10a6:10:518::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21; Mon, 15 Jan 2024 11:42:32 +0000 Received: from AM3PEPF00009BA2.eurprd04.prod.outlook.com (2603:10a6:20b:2f2:cafe::bd) by AS8P251CA0012.outlook.office365.com (2603:10a6:20b:2f2::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23 via Frontend Transport; Mon, 15 Jan 2024 11:42:31 +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 AM3PEPF00009BA2.mail.protection.outlook.com (10.167.16.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.16 via Frontend Transport; Mon, 15 Jan 2024 11:42:31 +0000 Received: ("Tessian outbound 67699c3f02bc:v228"); Mon, 15 Jan 2024 11:42:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6d8822dfa6d89248 X-CR-MTA-TID: 64aa7808 Received: from 4fa89c85be36.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8C6FECEF-0630-435C-902A-9ED5667A8733.1; Mon, 15 Jan 2024 11:26:50 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4fa89c85be36.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 15 Jan 2024 11:26:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HPZHrBAnHinHw88fVsJrtWxS3JOL5MPHGK0ql9eTlYAVq0XWUdYpw4ilgT5VrKgToupkJzylYQTbZjPVkZRit491kB+L3poTIsYDwmbTfzfAbIdyleIvOc11eho5yxv4DIQsPAoyT38klccHm5v9MK5zNzzfDyytG2b1iAZduBkLlgHjH4MfQ2/5zSV37rnKzb2dalAb7AfwWt307OxISyfjkUV1egxRTB7+Kc/ksiftGNAEwvFyqES3wmWuOd3Cx2tifWbNtdjzZFqchIbCFRicyMv/o9UC4TTgLBj4o2rmRjBwphPnSQjZvjj54gZuFvO5Gd0CPOplj4BE5JDdZQ== 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=7PbyILrqzb3ZIeWAdhjIerbLMNs3/eNpCtI0elVzILA=; b=KV+qSDhyTwCL2Tshm3Sb80xF0GQZzrghohgW9ldgQoz3m7tvr4Nj5ITHPEp62OWqsrlRM3CSZolWgWE6baogRkel8gbue4Y+CFRn3yzrvdL12hiofqXGj+Kk8nsU5ywsJoATBQQJ+4+1cjggmTcKvk2wZ4KD+bBGuLlp8aTJ44yaG7HJpmGVkYUL+jrefIV50eOCewlhRO+45ULFT3I5CL/pxx91xVhUkJAULyBLkx2AKme3v5YLqbG/t4IlRsSG5+1gUNh1eO3vExa85sQfbvtsTQGNxU3uUCi606Y89vnwR3RNr+V5V/pJcQRhUxoPARCzweh6F8QKm/4OTHzSbw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7PbyILrqzb3ZIeWAdhjIerbLMNs3/eNpCtI0elVzILA=; b=2VgkJG5HhYXk2Um+RdaOvQI6L5l1JWsYBgj/fkLwZg1UvE0XMa8MZzKAYuXKw4sz0a+Gb3k4Jcuoc1NRKsNLbq4jkua1GoI50JGOq3vkDgMOFZpLRK74qJdBLL36E0ImvBkyNhgqqn5zqK1F7WP1RbgdFQAqGBrfedd7tP4jvXM= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) by DU0PR08MB8929.eurprd08.prod.outlook.com (2603:10a6:10:464::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.19; Mon, 15 Jan 2024 11:26:47 +0000 Received: from AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::a997:a5ad:3e6:44b6]) by AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::a997:a5ad:3e6:44b6%4]) with mapi id 15.20.7181.022; Mon, 15 Jan 2024 11:26:47 +0000 Date: Mon, 15 Jan 2024 11:26:45 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Biener Subject: [PATCH 1/5] testsuite: Add tests for fmv symbol presence and mangling Message-ID: <5a334e27-3a1b-bc65-fdde-ac5926984542@e124511.cambridge.arm.com> References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P123CA0271.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:195::6) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|DU0PR08MB8929:EE_|AM3PEPF00009BA2:EE_|DU5PR08MB10609:EE_ X-MS-Office365-Filtering-Correlation-Id: 11cc2a79-1647-4a7d-db7b-08dc15bf0f3b 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: 9zNhML1b3u+N8qQLngClLCfkLhRS4XJyR0m9Nil0GEHePOcNS/QK0Rvkb5S0M7nLtJUYB3qkNoUgxBq1ahnzNzqmo5+vk92iHG/AGwXFS056EwoRDxY3SzZer1AfUJZqfMWs11Dy/430DoaBx4B+2n576PJs7xXZDnVGMsZ90TUvGXtuqip6wFFKHAR7bE2LHHYejHrRyQ3D/puUB78YVB1za7n6KIV/UzFvxdktu/9Rb/Snk88eMz7tnJkt8cQ4PpjF2fKiI/0UBK6G5eLQVsIqcwREY3EIEfNhFNyC7qdR6rqsJYVwmrzFZs5p8M4BYhl5lxcBiCWsJMnrGyPYuudQIlACwD3hfdE8FVI84DrAuK/XL/B/rQ2X+28470GTSJqsoRnHNeGM3cvA5S5iDLF0LBrXpTd/mQj/JB3eT8NwsmT8zxWrTkdZZB1LepoSv8gl48P8fcn516OEIzbX/pecpKnhz355gCzbiEXi6QpSZgtLzcyFBmwHxw3LXyxscvpmgi5ZDtleATt1gHaaOEDcGc/7ClxfXCa2PAG97PFV+wwbmghGgeH7GSyvnYCa2IqpCpD1+gcIJa7opywcD7rpsx2v/MzgvCt95U31A1vyF7aihTxsyBS5gBYTg7/H X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB6678.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(346002)(366004)(376002)(136003)(396003)(230273577357003)(230173577357003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(66946007)(6916009)(66476007)(66556008)(44832011)(6506007)(6512007)(316002)(6486002)(478600001)(41300700001)(8676002)(8936002)(4326008)(2906002)(5660300002)(30864003)(83380400001)(31696002)(26005)(31686004)(38100700002)(86362001)(579004); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8929 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: AM3PEPF00009BA2.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b7c76c43-e7f4-416f-2a1c-08dc15bcdc13 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y+l/rj1Zo3Bk4NiylaMgKoqvMUV76cE2N9Ye72/82j69r6492D6YRF5Pl2KlZABEpxMoTcRJW07MvqbwBzUwZKd/SZ2o5ydCAtVEJsPgoaP6pQgci5qKtQYRsjOOCPooBcrbar/YVHgrZ7p9Szz4cf3NxztLJTgelocz7f60ra7+LDot/K75BfxOueofb2ahR6YAyxOVdjzOHLeShOGPiPWg6CUD7XbiZfMkGbMmH+GEdl36YoyM+4N+DnCuymsXWO/u47QbC12/ODATorssaWhFPxi7KC0QVTy00P2di5dg53dSXE3nv6kbetYkYB8eM8ju/jp36nGJL6MEOsvObJbgF4bCG+qPwg24e00BxqCEgdx5Ui9ttBEdRGe14fVDEasw1CxYG0vqH79phYPkjiKliSS0oF3CEDJDVRs616qIfaeedS7rh3DPhBPW08QMAbK7/wAB5MNM+mDb1+NnPp5o2YfxSPMTjPvxiiQnf1c1nIHJCLr/Ae220k01JlWuq0l+a2BwS2ESAEfo5q15h8rHE22sPk7LeFX7skinMtqcDSS03LnV6k46Dm0hbTYrVnTygEx+29QPiwwYTlVt+h0iavEGHAf3PrSEVSMBmZN5I85rhi0lpXZqf3UihOzsJXnEu5CZtFH0A8KshJ996Q7PGtiBeiRvZ3/Vf1rw1yidkckxnL7z+pK1IsNnW7yRmzgdBHYaLRA6y4K7GsqEKmM4lI1NZYjo2Q6ZsVBf3sG4HuYj8c90ybinEralk7BskiDEhKhOYYBQaAXR7nmDzeXSEpIcKnzbl+dkxBt6h+U= 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:(13230031)(4636009)(346002)(39860400002)(376002)(396003)(136003)(230173577357003)(230273577357003)(230922051799003)(451199024)(64100799003)(82310400011)(186009)(1800799012)(46966006)(40470700004)(36840700001)(6506007)(31696002)(478600001)(47076005)(6486002)(36860700001)(26005)(336012)(41300700001)(107886003)(83380400001)(6512007)(40460700003)(40480700001)(5660300002)(70586007)(2906002)(44832011)(70206006)(30864003)(8936002)(356005)(6916009)(31686004)(4326008)(316002)(8676002)(81166007)(82740400003)(86362001)(579004); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 11:42:31.7504 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11cc2a79-1647-4a7d-db7b-08dc15bf0f3b 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: AM3PEPF00009BA2.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU5PR08MB10609 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org These tests are not intended to designate "correct" behaviour, but are instead intended to demonstrate current behaviour, and provide a warning if subsequent patches might lead to compatibility issues for targets with existing function multiversioning support. gcc/testsuite/ChangeLog: * g++.target/aarch64/mv-symbols1.C: New test. * g++.target/aarch64/mv-symbols2.C: New test. * g++.target/aarch64/mv-symbols3.C: New test. * g++.target/aarch64/mv-symbols4.C: New test. * g++.target/aarch64/mv-symbols5.C: New test. * g++.target/aarch64/mvc-symbols1.C: New test. * g++.target/aarch64/mvc-symbols2.C: New test. * g++.target/aarch64/mvc-symbols3.C: New test. * g++.target/aarch64/mvc-symbols4.C: New test. * g++.target/i386/mv-symbols1.C: New test. * g++.target/i386/mv-symbols2.C: New test. * g++.target/i386/mv-symbols3.C: New test. * g++.target/i386/mv-symbols4.C: New test. * g++.target/i386/mv-symbols5.C: New test. * g++.target/i386/mvc-symbols1.C: New test. * g++.target/i386/mvc-symbols2.C: New test. * g++.target/i386/mvc-symbols3.C: New test. * g++.target/i386/mvc-symbols4.C: New test. * g++.target/powerpc/mvc-symbols1.C: New test. * g++.target/powerpc/mvc-symbols2.C: New test. * g++.target/powerpc/mvc-symbols3.C: New test. * g++.target/powerpc/mvc-symbols4.C: New test. diff --git a/gcc/testsuite/g++.target/aarch64/mv-symbols1.C b/gcc/testsuite/g++.target/aarch64/mv-symbols1.C new file mode 100644 index 0000000000000000000000000000000000000000..afbd9cacfc72e89ff4a06e3baae7ccc63ed64fc0 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/mv-symbols1.C @@ -0,0 +1,66 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +int foo () +{ + return 1; +} + +__attribute__((target_version("dotprod"))) +int foo () +{ + return 3; +} +__attribute__((target_version("sve+sve2"))) +int foo () +{ + return 5; +} + +__attribute__((target_version("sve+sve2"))) +int foo (int) +{ + return 6; +} + +__attribute__((target_version("dotprod"))) +int foo (int) +{ + return 4; +} + +int foo (int) +{ + return 2; +} + + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mv-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\t_Z7_Z3foovv\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3foovv, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3foovv,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\t_Z7_Z3fooii\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3fooii, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3fooii,_Z3fooi\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/g++.target/aarch64/mv-symbols2.C b/gcc/testsuite/g++.target/aarch64/mv-symbols2.C new file mode 100644 index 0000000000000000000000000000000000000000..54d2396f40705b6a6f7839ded78dcfddd911f7dd --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/mv-symbols2.C @@ -0,0 +1,52 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_version("default"))) +int foo () +{ + return 1; +} + +__attribute__((target_version("dotprod"))) +int foo () +{ + return 3; +} +__attribute__((target_version("sve+sve2"))) +int foo () +{ + return 5; +} + +__attribute__((target_version("sve+sve2"))) +int foo (int) +{ + return 6; +} + +__attribute__((target_version("dotprod"))) +int foo (int) +{ + return 4; +} + +__attribute__((target_version("default"))) +int foo (int) +{ + return 2; +} + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3foovv, %gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3foovv,_Z3foov\.resolver\n" 0 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3fooii, %gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3fooii,_Z3fooi\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/aarch64/mv-symbols3.C b/gcc/testsuite/g++.target/aarch64/mv-symbols3.C new file mode 100644 index 0000000000000000000000000000000000000000..30e78b329851069e061e7ae179bbf78e1a2b4b04 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/mv-symbols3.C @@ -0,0 +1,41 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_version("default"))) +int foo (); + +__attribute__((target_version("dotprod"))) +int foo (); + +__attribute__((target_version("sve+sve2"))) +int foo (); + +__attribute__((target_version("default"))) +int foo (int); + +__attribute__((target_version("dotprod"))) +int foo (int); + +__attribute__((target_version("sve+sve2"))) +int foo (int); + +int bar() +{ + return foo (); +} + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\._Mdotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\._MsveMsve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\t_Z7_Z3foovv\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3foovv, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3foovv,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\._Mdotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\._MsveMsve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3fooii, %gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3fooii,_Z3fooi\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/aarch64/mv-symbols4.C b/gcc/testsuite/g++.target/aarch64/mv-symbols4.C new file mode 100644 index 0000000000000000000000000000000000000000..674f8f88dce6b6b374de1198ed16ebcae9f816ca --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/mv-symbols4.C @@ -0,0 +1,48 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_version("default"))) +int foo () +{ + return 1; +} + +__attribute__((target_version("dotprod"))) +int foo (); + +__attribute__((target_version("sve+sve2"))) +int foo (); + +__attribute__((target_version("default"))) +int foo (int) +{ + return 2; +} + +__attribute__((target_version("dotprod"))) +int foo (int); + +__attribute__((target_version("sve+sve2"))) +int foo (int); + + +int bar() +{ + return foo (); +} + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\._Mdotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\._MsveMsve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\t_Z7_Z3foovv\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3foovv, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3foovv,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\._Mdotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\._MsveMsve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3fooii, %gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3fooii,_Z3fooi\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/aarch64/mv-symbols5.C b/gcc/testsuite/g++.target/aarch64/mv-symbols5.C new file mode 100644 index 0000000000000000000000000000000000000000..38bc2bdfc21aa9846e574442e1f53dc31a7234aa --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/mv-symbols5.C @@ -0,0 +1,56 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_version("default"))) +int foo (); + +__attribute__((target_version("dotprod"))) +int foo () +{ + return 3; +} +__attribute__((target_version("sve+sve2"))) +int foo () +{ + return 5; +} + +__attribute__((target_version("default"))) +int foo (int); + +__attribute__((target_version("dotprod"))) +int foo (int) +{ + return 4; +} + +__attribute__((target_version("sve+sve2"))) +int foo (int) +{ + return 6; +} + + +int bar() +{ + return foo (); +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mvc-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\t_Z7_Z3foovv\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3foovv, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3foovv,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3fooii, %gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3fooii,_Z3fooi\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/aarch64/mvc-symbols1.C b/gcc/testsuite/g++.target/aarch64/mvc-symbols1.C new file mode 100644 index 0000000000000000000000000000000000000000..b32e9200e763e8e73316c0d56cf290dadb11b3c8 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/mvc-symbols1.C @@ -0,0 +1,44 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "dotprod", "sve+sve2"))) +int foo () +{ + return 1; +} + +__attribute__((target_clones("sve+sve2", "dotprod", "default"))) +int foo (int) +{ + return 2; +} + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mvc-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.dotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sve_sve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\t_Z3foov\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.dotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sve_sve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\t_Z3fooi\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/g++.target/aarch64/mvc-symbols2.C b/gcc/testsuite/g++.target/aarch64/mvc-symbols2.C new file mode 100644 index 0000000000000000000000000000000000000000..f57ae25549be709bbf00811f7b78725051a79b9f --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/mvc-symbols2.C @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "dotprod", "sve+sve2"))) +int foo () +{ + return 1; +} + +__attribute__((target_clones("sve+sve2", "dotprod", "default"))) +int foo (int) +{ + return 2; +} + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.dotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sve_sve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.dotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sve_sve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/g++.target/aarch64/mvc-symbols3.C b/gcc/testsuite/g++.target/aarch64/mvc-symbols3.C new file mode 100644 index 0000000000000000000000000000000000000000..86340d05b4ad8ab4c3a0c34aacf31e40f7099336 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/mvc-symbols3.C @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "dotprod", "sve+sve2"))) +int foo (); + +__attribute__((target_clones("sve+sve2", "dotprod", "default"))) +int foo (int); + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.dotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sve_sve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\t_Z3foov\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.dotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sve_sve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\t_Z3fooi\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/g++.target/aarch64/mvc-symbols4.C b/gcc/testsuite/g++.target/aarch64/mvc-symbols4.C new file mode 100644 index 0000000000000000000000000000000000000000..351545fd201ca80d3d0bb13afdca1d49f211519b --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/mvc-symbols4.C @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "dotprod", "sve+sve2"))) +int foo (); + +__attribute__((target_clones("sve+sve2", "dotprod", "default"))) +int foo (int); + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.dotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sve_sve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, %gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 0 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.dotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sve_sve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, %gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/i386/mv-symbols1.C b/gcc/testsuite/g++.target/i386/mv-symbols1.C new file mode 100644 index 0000000000000000000000000000000000000000..1290299aea5eff77de9951ee2fac5a626b7aa487 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/mv-symbols1.C @@ -0,0 +1,68 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target("default"))) +int foo () +{ + return 1; +} + +__attribute__((target("arch=slm"))) +int foo () +{ + return 3; +} + +__attribute__((target("sse4.2"))) +int foo () +{ + return 5; +} + +__attribute__((target("sse4.2"))) +int foo (int) +{ + return 6; +} + +__attribute__((target("arch=slm"))) +int foo (int) +{ + return 4; +} + +__attribute__((target("default"))) +int foo (int) +{ + return 2; +} + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mvc-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_slm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sse4.2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tcall\t_Z7_Z3foovv\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3foovv, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3foovv,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_slm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sse4.2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tcall\t_Z7_Z3fooii\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3fooii, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3fooii,_Z3fooi\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/g++.target/i386/mv-symbols2.C b/gcc/testsuite/g++.target/i386/mv-symbols2.C new file mode 100644 index 0000000000000000000000000000000000000000..8b75565d78d03abda18a3a99d6fa7010ee6c8515 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/mv-symbols2.C @@ -0,0 +1,56 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target("default"))) +int foo () +{ + return 1; +} + +__attribute__((target("arch=slm"))) +int foo () +{ + return 3; +} + +__attribute__((target("sse4.2"))) +int foo () +{ + return 5; +} + +__attribute__((target("sse4.2"))) +int foo (int) +{ + return 6; +} + +__attribute__((target("arch=slm"))) +int foo (int) +{ + return 4; +} + +__attribute__((target("default"))) +int foo (int) +{ + return 2; +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mvc-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_slm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sse4.2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3foovv, @gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3foovv,_Z3foov\.resolver\n" 0 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_slm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sse4.2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3fooii, @gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3fooii,_Z3fooi\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/i386/mv-symbols3.C b/gcc/testsuite/g++.target/i386/mv-symbols3.C new file mode 100644 index 0000000000000000000000000000000000000000..a5cf3445a4314d57ad7ff7296e88797b138f2a21 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/mv-symbols3.C @@ -0,0 +1,44 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target("default"))) +int foo (); + +__attribute__((target("arch=slm"))) +int foo (); + +__attribute__((target("sse4.2"))) +int foo (); + +__attribute__((target("sse4.2"))) +int foo (int); + +__attribute__((target("arch=slm"))) +int foo (int); + +__attribute__((target("default"))) +int foo (int); + +int bar() +{ + return foo (); +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mvc-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_slm:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sse4.2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tcall\t_Z7_Z3foovv\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3foovv, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3foovv,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_slm:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sse4.2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3fooii, @gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3fooii,_Z3fooi\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/i386/mv-symbols4.C b/gcc/testsuite/g++.target/i386/mv-symbols4.C new file mode 100644 index 0000000000000000000000000000000000000000..bb10f126f673fc08010ce97333102b9ae4952d6d --- /dev/null +++ b/gcc/testsuite/g++.target/i386/mv-symbols4.C @@ -0,0 +1,50 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target("default"))) +int foo () +{ + return 1; +} + +__attribute__((target("arch=slm"))) +int foo (); + +__attribute__((target("sse4.2"))) +int foo (); + +__attribute__((target("sse4.2"))) +int foo (int); + +__attribute__((target("arch=slm"))) +int foo (int); + +__attribute__((target("default"))) +int foo (int) +{ + return 2; +} + +int bar() +{ + return foo (); +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mvc-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_slm:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sse4.2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tcall\t_Z7_Z3foovv\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3foovv, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3foovv,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_slm:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sse4.2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3fooii, @gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3fooii,_Z3fooi\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/i386/mv-symbols5.C b/gcc/testsuite/g++.target/i386/mv-symbols5.C new file mode 100644 index 0000000000000000000000000000000000000000..d36e4c304c2d1a62257ea0e1bc54d35d66358cce --- /dev/null +++ b/gcc/testsuite/g++.target/i386/mv-symbols5.C @@ -0,0 +1,56 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target("default"))) +int foo (); + +__attribute__((target("arch=slm"))) +int foo () +{ + return 3; +} + +__attribute__((target("sse4.2"))) +int foo () +{ + return 5; +} + +__attribute__((target("sse4.2"))) +int foo (int) +{ + return 6; +} + +__attribute__((target("arch=slm"))) +int foo (int) +{ + return 4; +} + +__attribute__((target("default"))) +int foo (int); + +int bar() +{ + return foo (); +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mvc-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_slm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sse4.2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tcall\t_Z7_Z3foovv\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3foovv, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3foovv,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_slm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sse4.2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z7_Z3fooii, @gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z7_Z3fooii,_Z3fooi\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/i386/mvc-symbols1.C b/gcc/testsuite/g++.target/i386/mvc-symbols1.C new file mode 100644 index 0000000000000000000000000000000000000000..ea8c434c353e8eacea73a2285438d02011ba21a0 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/mvc-symbols1.C @@ -0,0 +1,44 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "arch=slm", "sse4.2"))) +int foo () +{ + return 1; +} + +__attribute__((target_clones("sse4.2", "arch=slm", "default"))) +int foo (int) +{ + return 2; +} + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mvc-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_slm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sse4_2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tcall\t_Z3foov\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_slm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sse4_2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tcall\t_Z3fooi\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/g++.target/i386/mvc-symbols2.C b/gcc/testsuite/g++.target/i386/mvc-symbols2.C new file mode 100644 index 0000000000000000000000000000000000000000..84b54a980b33df95dcc238cd3be4b4fdd041fe62 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/mvc-symbols2.C @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "arch=slm", "sse4.2"))) +int foo () +{ + return 1; +} + +__attribute__((target_clones("sse4.2", "arch=slm", "default"))) +int foo (int) +{ + return 2; +} + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_slm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sse4_2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_slm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sse4_2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/g++.target/i386/mvc-symbols3.C b/gcc/testsuite/g++.target/i386/mvc-symbols3.C new file mode 100644 index 0000000000000000000000000000000000000000..33927071028d7508d46e779eb9a85a40e0cbd37e --- /dev/null +++ b/gcc/testsuite/g++.target/i386/mvc-symbols3.C @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "arch=slm", "sse4.2"))) +int foo (); + +__attribute__((target_clones("sse4.2", "arch=slm", "default"))) +int foo (int); + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_slm:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sse4_2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tcall\t_Z3foov\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_slm:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sse4_2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tcall\t_Z3fooi\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/g++.target/i386/mvc-symbols4.C b/gcc/testsuite/g++.target/i386/mvc-symbols4.C new file mode 100644 index 0000000000000000000000000000000000000000..ed9bc8f3e16f9a43412d089ff607887a48ccf2cc --- /dev/null +++ b/gcc/testsuite/g++.target/i386/mvc-symbols4.C @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "arch=slm", "sse4.2"))) +int foo (); + +__attribute__((target_clones("sse4.2", "arch=slm", "default"))) +int foo (int); + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_slm:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.sse4_2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, @gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 0 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_slm:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.sse4_2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, @gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/powerpc/mvc-symbols1.C b/gcc/testsuite/g++.target/powerpc/mvc-symbols1.C new file mode 100644 index 0000000000000000000000000000000000000000..8b331ed3a048d3e3422d716ef399011675af9955 --- /dev/null +++ b/gcc/testsuite/g++.target/powerpc/mvc-symbols1.C @@ -0,0 +1,47 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "cpu=power6", "cpu=power6x"))) +int foo () +{ + return 1; +} + +__attribute__((target_clones("cpu=power6x", "cpu=power6", "default"))) +int foo (int) +{ + return 2; +} + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.cpu_power6:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.cpu_power6x:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl _Z3foov\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.default@ha\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.cpu_power6@ha\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.cpu_power6x@ha\n" 0 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.cpu_power6:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.cpu_power6x:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl _Z3fooi\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.default@ha\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.cpu_power6@ha\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.cpu_power6x@ha\n" 1 } } */ diff --git a/gcc/testsuite/g++.target/powerpc/mvc-symbols2.C b/gcc/testsuite/g++.target/powerpc/mvc-symbols2.C new file mode 100644 index 0000000000000000000000000000000000000000..f62427faf037e32015276d0960495d1fe39b790d --- /dev/null +++ b/gcc/testsuite/g++.target/powerpc/mvc-symbols2.C @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "cpu=power6", "cpu=power6x"))) +int foo () +{ + return 1; +} + +__attribute__((target_clones("cpu=power6x", "cpu=power6", "default"))) +int foo (int) +{ + return 2; +} + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.cpu_power6:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.cpu_power6x:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.default@ha\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.cpu_power6@ha\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.cpu_power6x@ha\n" 0 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.cpu_power6:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.cpu_power6x:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.default@ha\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.cpu_power6@ha\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.cpu_power6x@ha\n" 1 } } */ diff --git a/gcc/testsuite/g++.target/powerpc/mvc-symbols3.C b/gcc/testsuite/g++.target/powerpc/mvc-symbols3.C new file mode 100644 index 0000000000000000000000000000000000000000..d5813922961a17a0788bd6a53255743f750783d6 --- /dev/null +++ b/gcc/testsuite/g++.target/powerpc/mvc-symbols3.C @@ -0,0 +1,41 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "cpu=power6", "cpu=power6x"))) +int foo (); + +__attribute__((target_clones("cpu=power6x", "cpu=power6", "default"))) +int foo (int); + +int bar() +{ + return foo (); +} + +int bar(int x) +{ + return foo (x); +} + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.cpu_power6:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.cpu_power6x:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl _Z3foov\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.default@ha\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.cpu_power6@ha\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.cpu_power6x@ha\n" 0 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.cpu_power6:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.cpu_power6x:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl _Z3fooi\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, @gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.default@ha\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.cpu_power6@ha\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.cpu_power6x@ha\n" 0 } } */ diff --git a/gcc/testsuite/g++.target/powerpc/mvc-symbols4.C b/gcc/testsuite/g++.target/powerpc/mvc-symbols4.C new file mode 100644 index 0000000000000000000000000000000000000000..ec111f53d935641aeda579e928822e71797e8301 --- /dev/null +++ b/gcc/testsuite/g++.target/powerpc/mvc-symbols4.C @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-require-ifunc "" } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "cpu=power6", "cpu=power6x"))) +int foo (); + +__attribute__((target_clones("cpu=power6x", "cpu=power6", "default"))) +int foo (int); + +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.cpu_power6:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.cpu_power6x:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, @gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.default@ha\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.cpu_power6@ha\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3foov\.cpu_power6x@ha\n" 0 } } */ + +/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.cpu_power6:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.cpu_power6x:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, @gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.default@ha\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.cpu_power6@ha\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\tlis \[\\d\]+,_Z3fooi\.cpu_power6x@ha\n" 0 } } */