@@ -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
From: Szabolcs Nagy <szabolcs.nagy@arm.com> 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(+)