aarch64: Add target pragma tests for gcs

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/pragma_cpp_predefs_4.c: Add gcs specific
	tests.
This commit is contained in:
Szabolcs Nagy 2024-11-14 16:15:10 +00:00 committed by Richard Sandiford
parent 500de6c0e5
commit c283cf27b0

View file

@ -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