testsuite: Add extra aarch64 predefine tests
authorFei Yang <felix.yang@huawei.com>
Thu, 23 Apr 2020 15:08:03 +0000 (16:08 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 23 Apr 2020 15:08:03 +0000 (16:08 +0100)
Add extra testing in the following two tests to make sure CPP predefines
redefinitions on #pragma works as expected when -mgeneral-regs-only
option is specified (See PR94678):
gcc.target/aarch64/pragma_cpp_predefs_2.c
gcc.target/aarch64/pragma_cpp_predefs_3.c

2020-04-23  Felix Yang  <felix.yang@huawei.com>

gcc/testsuite/
PR target/94678
* gcc.target/aarch64/pragma_cpp_predefs_2.c: Fix typos, pop_pragma ->
pop_options. Add tests for general-regs-only.
* gcc.target/aarch64/pragma_cpp_predefs_3.c: Add tests for
general-regs-only.

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_2.c
gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_3.c

index c0caffbd05f5d5c561d686efa37ac5d7c91346dd..4f5f020efce4b1c3591abccc8921f0a652e1fe1f 100644 (file)
@@ -1,3 +1,11 @@
+2020-04-23  Felix Yang  <felix.yang@huawei.com>
+
+       PR target/94678
+       * gcc.target/aarch64/pragma_cpp_predefs_2.c: Fix typos, pop_pragma ->
+       pop_options. Add tests for general-regs-only.
+       * gcc.target/aarch64/pragma_cpp_predefs_3.c: Add tests for
+       general-regs-only.
+
 2020-04-23  Andrew Stubbs  <ams@codesourcery.com>
            Thomas Schwinge  <thomas@codesourcery.com>
 
index fa226759893088d384a707c6ec73b36a3aa93641..7244359ccfb9cbcbbd8285b050113c004a6af2a6 100644 (file)
@@ -67,7 +67,7 @@
 #ifdef __ARM_FEATURE_SVE_MATMUL_FP64
 #error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
 #endif
-#pragma GCC pop_pragma
+#pragma GCC pop_options
 
 #pragma GCC push_options
 #pragma GCC target ("arch=armv8.2-a+i8mm")
 #ifdef __ARM_FEATURE_SVE_MATMUL_FP64
 #error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
 #endif
-#pragma GCC pop_pragma
+#pragma GCC pop_options
 
 #pragma GCC push_options
 #pragma GCC target ("arch=armv8.2-a+f64mm")
 
 #pragma GCC pop_options
 
+/* Make sure that general-regs-only works too.  */
+#pragma GCC push_options
+#pragma GCC target ("arch=armv8.2-a+sve+i8mm+f32mm+f64mm")
+#ifndef __ARM_FEATURE_SVE
+#error "__ARM_FEATURE_SVE is not defined but should be!"
+#endif
+#ifndef __ARM_FEATURE_SVE_MATMUL_INT8
+#error "__ARM_FEATURE_SVE_MATMUL_INT8 is not defined but should be!"
+#endif
+#ifndef __ARM_FEATURE_SVE_MATMUL_FP32
+#error "__ARM_FEATURE_SVE_MATMUL_FP32 is not defined but should be!"
+#endif
+#ifndef __ARM_FEATURE_SVE_MATMUL_FP64
+#error "__ARM_FEATURE_SVE_MATMUL_FP64 is not defined but should be!"
+#endif
+
+#pragma GCC push_options
+#pragma GCC target ("general-regs-only")
+#ifdef __ARM_FEATURE_SVE
+#error "__ARM_FEATURE_SVE is defined but should not be!"
+#endif
+#ifdef __ARM_FEATURE_SVE_MATMUL_INT8
+#error "__ARM_FEATURE_SVE_MATMUL_INT8 is defined but should not be!"
+#endif
+#ifdef __ARM_FEATURE_SVE_MATMUL_FP32
+#error "__ARM_FEATURE_SVE_MATMUL_FP32 is defined but should not be!"
+#endif
+#ifdef __ARM_FEATURE_SVE_MATMUL_FP64
+#error "__ARM_FEATURE_SVE_MATMUL_FP64 is defined but should not be!"
+#endif
+#pragma GCC pop_options
+
+#pragma GCC pop_options
+
 int
 foo (int a)
 {
index 34aa6e16bcc494acf2efe62e769a8c8bd08b967b..39128528600f54195f6b092886e8d172317f2877 100644 (file)
 
 #pragma GCC pop_options
 
+/* Make sure that general-regs-only works too.  */
+#pragma GCC push_options
+#pragma GCC target ("arch=armv8.5-a+sve2-aes+sve2-bitperm+sve2-sha3+sve2-sm4")
+
+#ifndef __ARM_FEATURE_SVE
+#error "__ARM_FEATURE_SVE is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2
+#error "__ARM_FEATURE_SVE2 is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2_AES
+#error "__ARM_FEATURE_SVE2_AES is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2_BITPERM
+#error "__ARM_FEATURE_SVE2_BITPERM is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2_SHA3
+#error "__ARM_FEATURE_SVE2_SHA3 is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2_SM4
+#error "__ARM_FEATURE_SVE2_SM4 is not defined but should be!"
+#endif
+
+#pragma GCC push_options
+#pragma GCC target ("general-regs-only")
+
+#ifdef __ARM_FEATURE_SVE
+#error "__ARM_FEATURE_SVE is defined but should not be!"
+#endif
+
+#ifdef __ARM_FEATURE_SVE2
+#error "__ARM_FEATURE_SVE2 is defined but should not be!"
+#endif
+
+#ifdef __ARM_FEATURE_SVE2_AES
+#error "__ARM_FEATURE_SVE2_AES is defined but should not be!"
+#endif
+
+#ifdef __ARM_FEATURE_SVE2_BITPERM
+#error "__ARM_FEATURE_SVE2_BITPERM is defined but should not be!"
+#endif
+
+#ifdef __ARM_FEATURE_SVE2_SHA3
+#error "__ARM_FEATURE_SVE2_SHA3 is defined but should not be!"
+#endif
+
+#ifdef __ARM_FEATURE_SVE2_SM4
+#error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
+#endif
+
+#pragma GCC pop_options
+
+#pragma GCC pop_options
+
 int
 foo (int a)
 {