public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/gccgo] testsuite: Add extra aarch64 predefine tests
@ 2020-07-12 17:29 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2020-07-12 17:29 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:857d1fa3f0a04569382bab12829e5bfd3725ecbf

commit 857d1fa3f0a04569382bab12829e5bfd3725ecbf
Author: Fei Yang <felix.yang@huawei.com>
Date:   Thu Apr 23 16:08:03 2020 +0100

    testsuite: Add extra aarch64 predefine tests
    
    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.

Diff:
---
 gcc/testsuite/ChangeLog                            |  8 +++
 .../gcc.target/aarch64/pragma_cpp_predefs_2.c      | 38 +++++++++++++-
 .../gcc.target/aarch64/pragma_cpp_predefs_3.c      | 59 ++++++++++++++++++++++
 3 files changed, 103 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c0caffbd05f..4f5f020efce 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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>
 
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_2.c b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_2.c
index fa226759893..7244359ccfb 100644
--- a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_2.c
@@ -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")
@@ -115,7 +115,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+f64mm")
@@ -208,6 +208,40 @@
 
 #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)
 {
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_3.c b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_3.c
index 34aa6e16bcc..39128528600 100644
--- a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_3.c
+++ b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_3.c
@@ -214,6 +214,65 @@
 
 #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)
 {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-12 17:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-12 17:29 [gcc/devel/gccgo] testsuite: Add extra aarch64 predefine tests Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).