From patchwork Fri Nov 8 14:48:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Khrustalev X-Patchwork-Id: 2008519 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XlMQS6tdrz1xyM for ; Sat, 9 Nov 2024 01:53:52 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 221AD3858D20 for ; Fri, 8 Nov 2024 14:53:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 1E748385782C; Fri, 8 Nov 2024 14:50:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E748385782C 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 1E748385782C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731077447; cv=none; b=NazidbpH7OC2JsvRR2CgfSb1iqOIcO5TleLl5qmMYf/VOvUaBxmAyGR8/UkEz5AxYGqIdhwqN8fWQnRURoNzZpGtk/h2V6Ts2EbmHEKJ3NwvTZfk2cPrznN64wPalUGQSM0lcqTFV83LbXykvhPNkVok2wP6tj2ubfkqFfnU+eY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731077447; c=relaxed/simple; bh=lY69+S7SQwIN6hGXEjiB3vlrJN14VG8/7uGhg/reZTs=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=XntUVefTqxIQ3xg5dfllNJgAv6OfEyFFyoc1CJuUry4O+H8OL+M6pNrT5IMhUhP7B85qM5MrF462KDBXVsRV5dqml0QxjVoTECST5tcXp+IYejkEgtSzmBKZzPBBU2h9f33K9nnk7OjavBH4Ddw6N8D2m0uD/lL/XaDGSrR8z0Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B6A0C339; Fri, 8 Nov 2024 06:51:12 -0800 (PST) Received: from udebian.localdomain (unknown [10.57.26.225]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 754A63F528; Fri, 8 Nov 2024 06:50:41 -0800 (PST) From: Yury Khrustalev To: gcc-patches@gcc.gnu.org Cc: nsz@gcc.gnu.org, richard.earnshaw@arm.com, matthieu.longo@arm.com, richard.ball@arm.com, richard.sandiford@arm.com, ktkachov@nvidia.com, john.brawn@arm.com Subject: [PATCH v3 15/23] aarch64: Add target pragma tests for gcs Date: Fri, 8 Nov 2024 14:48:08 +0000 Message-Id: <20241108144816.2681175-16-yury.khrustalev@arm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241108144816.2681175-1-yury.khrustalev@arm.com> References: <20241108144816.2681175-1-yury.khrustalev@arm.com> MIME-Version: 1.0 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~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Szabolcs Nagy gcc/testsuite/ChangeLog: * gcc.target/aarch64/pragma_cpp_predefs_4.c: Add gcs specific tests. --- .../gcc.target/aarch64/pragma_cpp_predefs_4.c | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_4.c b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_4.c index 8e707630774..417293d4d5a 100644 --- a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_4.c +++ b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_4.c @@ -91,6 +91,9 @@ #if __ARM_FEATURE_PAC_DEFAULT != 1 #error Foo #endif +#ifndef __ARM_FEATURE_GCS_DEFAULT +#error Foo +#endif #pragma GCC target ("branch-protection=none") #ifdef __ARM_FEATURE_BTI_DEFAULT @@ -99,6 +102,9 @@ #ifdef __ARM_FEATURE_PAC_DEFAULT #error Foo #endif +#ifdef __ARM_FEATURE_GCS_DEFAULT +#error Foo +#endif #pragma GCC push_options #pragma GCC target "branch-protection=bti+pac-ret" @@ -117,6 +123,9 @@ #ifdef __ARM_FEATURE_PAC_DEFAULT #error Foo #endif +#ifdef __ARM_FEATURE_GCS_DEFAULT +#error Foo +#endif #pragma GCC target "branch-protection=pac-ret" #ifdef __ARM_FEATURE_BTI_DEFAULT @@ -133,3 +142,29 @@ #if __ARM_FEATURE_PAC_DEFAULT != 6 #error Foo #endif + +#pragma GCC target "branch-protection=gcs" +#ifdef __ARM_FEATURE_BTI_DEFAULT +#error Foo +#endif +#ifdef __ARM_FEATURE_PAC_DEFAULT +#error Foo +#endif +#ifndef __ARM_FEATURE_GCS_DEFAULT +#error Foo +#endif + +#pragma GCC target "arch=armv8.8-a+gcs" +#ifndef __ARM_FEATURE_GCS +#error Foo +#endif + +#pragma GCC target "arch=armv8.8-a+nogcs" +#ifdef __ARM_FEATURE_GCS +#error Foo +#endif + +#pragma GCC target "arch=armv8.8-a" +#ifdef __ARM_FEATURE_GCS +#error Foo +#endif