x86: Clean up gcc.target/i386/auto-init-* tests

Message ID CAMe9rOpcTskiVJriK5EDZh6e4NpgtthgcwtQBOMz5sfJjTURTw@mail.gmail.com
State New
Headers
Series x86: Clean up gcc.target/i386/auto-init-* tests |

Commit Message

H.J. Lu Sept. 20, 2021, 3:19 p.m. UTC
  On Fri, Sep 17, 2021 at 10:32 AM Qing Zhao via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
>
> > On Sep 17, 2021, at 11:59 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> >
> > On Fri, Sep 17, 2021 at 04:55:22PM +0000, Qing Zhao wrote:
> >> This is the patch to fix gcc.target/i386/auto-init-* tests.
> >>
> >> I have tested the change at X86_64-linux with
> >>
> >> make check-gcc RUNTESTFLAGS='--target_board=unix\{-m64,-m64/-march=skylake-avx512,-m64/-fstack-protector-all,-m64/-fstack-clash-protection,-m32/-mno-sse,-m32/-mtune=bonnell,-m32/-march=bonnell,-m32/-fstack-protector-all/-fstack-clash-protection\} i386.exp=auto-init*’
> >>
> >> make check-gcc RUNTESTFLAGS='--target_board=unix\{-m64,-m64/-march=skylake-avx512/-fPIC,-m64/-fstack-protector-all/-fPIC,-m64/-fstack-clash-protection/-fPIC,-m32/-mno-sse/-fPIC,-m32/-mtune=bonnell/-fPIC,-m32/-march=bonnell/-fPIC,-m32/-fstack-protector-all/-fstack-clash-protection/-fPIC\} i386.exp=auto-init*’
> >>
> >> Everything works fine.
> >>
> >> Okay for commit?
> >
> > LGTM.
>
> Thank you.
>
> I will commit the change soon.
>
> For the aarch64 tests, do you have a suggestion on what the option combination I should test?
>

Here is the followup patch to clean up these tests:

1. Replace ia32 with { ! lp64 } to enable ILP32 tests for -mx32.
2. Replace lp64 with { ! ia32 } to enable x86-64 ISA tests for -mx32.
3. For auto-init-3.c, add -msse and -mfpmath=387 for ia32.

Any comments?
  

Comments

H.J. Lu Sept. 22, 2021, 3:43 a.m. UTC | #1
On Mon, Sep 20, 2021 at 8:19 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Fri, Sep 17, 2021 at 10:32 AM Qing Zhao via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> >
> >
> > > On Sep 17, 2021, at 11:59 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> > >
> > > On Fri, Sep 17, 2021 at 04:55:22PM +0000, Qing Zhao wrote:
> > >> This is the patch to fix gcc.target/i386/auto-init-* tests.
> > >>
> > >> I have tested the change at X86_64-linux with
> > >>
> > >> make check-gcc RUNTESTFLAGS='--target_board=unix\{-m64,-m64/-march=skylake-avx512,-m64/-fstack-protector-all,-m64/-fstack-clash-protection,-m32/-mno-sse,-m32/-mtune=bonnell,-m32/-march=bonnell,-m32/-fstack-protector-all/-fstack-clash-protection\} i386.exp=auto-init*’
> > >>
> > >> make check-gcc RUNTESTFLAGS='--target_board=unix\{-m64,-m64/-march=skylake-avx512/-fPIC,-m64/-fstack-protector-all/-fPIC,-m64/-fstack-clash-protection/-fPIC,-m32/-mno-sse/-fPIC,-m32/-mtune=bonnell/-fPIC,-m32/-march=bonnell/-fPIC,-m32/-fstack-protector-all/-fstack-clash-protection/-fPIC\} i386.exp=auto-init*’
> > >>
> > >> Everything works fine.
> > >>
> > >> Okay for commit?
> > >
> > > LGTM.
> >
> > Thank you.
> >
> > I will commit the change soon.
> >
> > For the aarch64 tests, do you have a suggestion on what the option combination I should test?
> >
>
> Here is the followup patch to clean up these tests:
>
> 1. Replace ia32 with { ! lp64 } to enable ILP32 tests for -mx32.
> 2. Replace lp64 with { ! ia32 } to enable x86-64 ISA tests for -mx32.
> 3. For auto-init-3.c, add -msse and -mfpmath=387 for ia32.
>
> Any comments?

I will check it in tomorrow.
  

Patch

From 79831005e6d63e17d077d3c94b6f3c1e097c3da8 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Mon, 20 Sep 2021 07:48:05 -0700
Subject: [PATCH] x86: Clean up gcc.target/i386/auto-init-* tests

1. Replace ia32 with { ! lp64 } to enable ILP32 tests for -mx32.
2. Replace lp64 with { ! ia32 } to enable x86-64 ISA tests for -mx32.
3. For auto-init-3.c, add -msse and -mfpmath=387 for ia32.

	* gcc.target/i386/auto-init-2.c: Replace ia32 with { ! lp64 }.
	* gcc.target/i386/auto-init-3.c (dg-options): Add -msse.
	(dg-additional-options): Add -mfpmath=387 for ia32.
	Replace lp64 with { ! ia32 }. Add a space after ia32.
	* gcc.target/i386/auto-init-4.c: Replace lp64 with { ! ia32 }.
	* gcc.target/i386/auto-init-5.c: Likewise.
	* gcc.target/i386/auto-init-padding-3.c: Likewise.
	* gcc.target/i386/auto-init-padding-7.c: Likewise.
	* gcc.target/i386/auto-init-padding-8.c: Likewise.
	* gcc.target/i386/auto-init-padding-9.c: Likewise.
---
 gcc/testsuite/gcc.target/i386/auto-init-2.c         | 5 ++---
 gcc/testsuite/gcc.target/i386/auto-init-3.c         | 7 ++++---
 gcc/testsuite/gcc.target/i386/auto-init-4.c         | 7 +++----
 gcc/testsuite/gcc.target/i386/auto-init-5.c         | 4 +---
 gcc/testsuite/gcc.target/i386/auto-init-padding-3.c | 6 ++----
 gcc/testsuite/gcc.target/i386/auto-init-padding-7.c | 4 +---
 gcc/testsuite/gcc.target/i386/auto-init-padding-8.c | 2 +-
 gcc/testsuite/gcc.target/i386/auto-init-padding-9.c | 4 ++--
 8 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/auto-init-2.c b/gcc/testsuite/gcc.target/i386/auto-init-2.c
index b23f733a403..e22930ae89b 100644
--- a/gcc/testsuite/gcc.target/i386/auto-init-2.c
+++ b/gcc/testsuite/gcc.target/i386/auto-init-2.c
@@ -33,6 +33,5 @@  void foo()
 /* { dg-final { scan-rtl-dump-times "0xfffffffffffffefe" 1 "expand" } } */
 /* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 2 "expand" { target lp64 } } } */
 /* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 3 "expand" { target lp64 } } } */
-/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 4 "expand" { target ia32 } } } */
-/* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 1 "expand" { target ia32 } } } */
-
+/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 4 "expand" { target { ! lp64 } } } } */
+/* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 1 "expand" { target { ! lp64 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/auto-init-3.c b/gcc/testsuite/gcc.target/i386/auto-init-3.c
index df317616db3..891eab1c40b 100644
--- a/gcc/testsuite/gcc.target/i386/auto-init-3.c
+++ b/gcc/testsuite/gcc.target/i386/auto-init-3.c
@@ -1,6 +1,7 @@ 
 /* Verify zero initialization for floating point type automatic variables.  */
 /* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64 -mtune=generic" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64 -mtune=generic -msse" } */
+/* { dg-additional-options "-mfpmath=387" { target ia32 } } */
 
 long double result;
 
@@ -14,5 +15,5 @@  long double foo()
   return result;
 }
 
-/* { dg-final { scan-assembler-times "pxor\t\\\%xmm0, \\\%xmm0" 3  { target lp64 } } } */
-/* { dg-final { scan-assembler-times "fldz" 3  { target ia32} } } */
+/* { dg-final { scan-assembler-times "pxor\t\\\%xmm0, \\\%xmm0" 3  { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler-times "fldz" 3  { target ia32 } } } */
diff --git a/gcc/testsuite/gcc.target/i386/auto-init-4.c b/gcc/testsuite/gcc.target/i386/auto-init-4.c
index 554a2c57eb6..7b46c74a073 100644
--- a/gcc/testsuite/gcc.target/i386/auto-init-4.c
+++ b/gcc/testsuite/gcc.target/i386/auto-init-4.c
@@ -14,9 +14,8 @@  long double foo()
   return result;
 }
 
-/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 1 "expand" { target lp64 } } } */
-/* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 1 "expand" { target lp64 } } } */
-/* { dg-final { scan-rtl-dump-times "0xfffffffffffffffe\\\]\\\) repeated x16" 1 "expand" { target lp64 } } } */
+/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 1 "expand" { target { ! ia32 } } } } */
+/* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 1 "expand" { target { ! ia32 } } } } */
+/* { dg-final { scan-rtl-dump-times "0xfffffffffffffffe\\\]\\\) repeated x16" 1 "expand" { target { ! ia32 } } } } */
 /* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 2 "expand" { target ia32 } } } */
 /* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 2 "expand" { target ia32 } } } */
-
diff --git a/gcc/testsuite/gcc.target/i386/auto-init-5.c b/gcc/testsuite/gcc.target/i386/auto-init-5.c
index 27d971f8cf1..0e9d74f9852 100644
--- a/gcc/testsuite/gcc.target/i386/auto-init-5.c
+++ b/gcc/testsuite/gcc.target/i386/auto-init-5.c
@@ -15,7 +15,5 @@  _Complex long double foo()
   return result;
 }
 
-/* { dg-final { scan-assembler-times "\\.long\t0" 14 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "\\.long\t0" 14 { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler-times "\\.long\t0" 12 { target ia32 } } } */
-
-
diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c
index 220a9f26348..7c20a28508f 100644
--- a/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c
+++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c
@@ -24,9 +24,7 @@  int foo ()
 }
 
 /* { dg-final { scan-assembler "movl\t\\\$0," } } */
-/* { dg-final { scan-assembler "movl\t\\\$16," { target lp64 } } } */
-/* { dg-final { scan-assembler "rep stosq" { target lp64 } } } */
+/* { dg-final { scan-assembler "movl\t\\\$16," { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler "rep stosq" { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler "movl\t\\\$32," { target ia32 } } } */
 /* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */
-
-
diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c
index c136e1cffc4..c3823de905d 100644
--- a/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c
+++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c
@@ -18,6 +18,4 @@  int foo ()
 }
 
 /* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\) repeated x16" 1 "expand" { target ia32 } } } */
-/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target lp64 } } } */
-
-
+/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c
index 45baa3c01a3..4f45755c90d 100644
--- a/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c
+++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c
@@ -18,4 +18,4 @@  int foo ()
 }
 
 /* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\) repeated x16" 1 "expand" { target ia32 } } } */
-/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target lp64 } } } */
+/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c
index eafa3272dab..a87b68b255b 100644
--- a/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c
+++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c
@@ -19,7 +19,7 @@  int foo ()
 }
 
 /* { dg-final { scan-assembler "movl\t\\\$0," } } */
-/* { dg-final { scan-assembler "movl\t\\\$20," { target lp64} } } */
-/* { dg-final { scan-assembler "rep stosq" { target lp64 } } } */
+/* { dg-final { scan-assembler "movl\t\\\$20," { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler "rep stosq" { target { ! ia32 } } } } */
 /* { dg-final { scan-assembler "movl\t\\\$40," { target ia32} } } */
 /* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */
-- 
2.31.1