[04/31] VAX/testsuite: Run target testing over all the usual optimization levels

Message ID alpine.LFD.2.21.2011200234170.656242@eddie.linux-mips.org
State New
Headers show
Series
  • VAX: Bring the port up to date (yes, MODE_CC conversion is included)
Related show

Commit Message

Maciej W. Rozycki Nov. 20, 2020, 3:34 a.m.
It makes sense to use what other targets do and run all the VAX test
cases over all the usual optimization levels, so make `vax.exp' use our
`gcc-dg-runtest' rather than the generic `dg-runtest' test driver.

This breaks `pr56875.c' however, which is optimized away at levels above
`-O0' as a result of how it has been written for calculations to make no
effect:

FAIL: gcc.target/vax/pr56875.c   -O1   scan-assembler ashq .*,\\$0xffffffffffffffff,
FAIL: gcc.target/vax/pr56875.c   -O2   scan-assembler ashq .*,\\$0xffffffffffffffff,
FAIL: gcc.target/vax/pr56875.c   -O3 -g   scan-assembler ashq .*,\\$0xffffffffffffffff,
FAIL: gcc.target/vax/pr56875.c   -Os   scan-assembler ashq .*,\\$0xffffffffffffffff,
FAIL: gcc.target/vax/pr56875.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none   scan-assembler ashq .*,\\$0xffffffffffffffff,
FAIL: gcc.target/vax/pr56875.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects   scan-assembler ashq .*,\\$0xffffffffffffffff,

Rather than keeping it at `-O0' update the test case for its code to do
make effect while retaining its sense.  Also reformat it according to
our requirements.

	gcc/testsuite/
	* gcc.target/vax/vax.exp: Use `gcc-dg-runtest' rather than
	`dg-runtest'.
	* gcc.target/vax/pr56875.c (dg-options): Make empty.
	(a): Rewrite for calculations to make effect.  Reformat.
---
 gcc/testsuite/gcc.target/vax/pr56875.c | 11 ++++-------
 gcc/testsuite/gcc.target/vax/vax.exp   |  2 +-
 2 files changed, 5 insertions(+), 8 deletions(-)

-- 
2.11.0

Comments

Jakub Jelinek via Gcc-patches Nov. 20, 2020, 11:17 p.m. | #1
On 11/19/20 8:34 PM, Maciej W. Rozycki wrote:
> It makes sense to use what other targets do and run all the VAX test

> cases over all the usual optimization levels, so make `vax.exp' use our

> `gcc-dg-runtest' rather than the generic `dg-runtest' test driver.

>

> This breaks `pr56875.c' however, which is optimized away at levels above

> `-O0' as a result of how it has been written for calculations to make no

> effect:

>

> FAIL: gcc.target/vax/pr56875.c   -O1   scan-assembler ashq .*,\\$0xffffffffffffffff,

> FAIL: gcc.target/vax/pr56875.c   -O2   scan-assembler ashq .*,\\$0xffffffffffffffff,

> FAIL: gcc.target/vax/pr56875.c   -O3 -g   scan-assembler ashq .*,\\$0xffffffffffffffff,

> FAIL: gcc.target/vax/pr56875.c   -Os   scan-assembler ashq .*,\\$0xffffffffffffffff,

> FAIL: gcc.target/vax/pr56875.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none   scan-assembler ashq .*,\\$0xffffffffffffffff,

> FAIL: gcc.target/vax/pr56875.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects   scan-assembler ashq .*,\\$0xffffffffffffffff,

>

> Rather than keeping it at `-O0' update the test case for its code to do

> make effect while retaining its sense.  Also reformat it according to

> our requirements.

>

> 	gcc/testsuite/

> 	* gcc.target/vax/vax.exp: Use `gcc-dg-runtest' rather than

> 	`dg-runtest'.

> 	* gcc.target/vax/pr56875.c (dg-options): Make empty.

> 	(a): Rewrite for calculations to make effect.  Reformat.

OK
jeff

Patch

diff --git a/gcc/testsuite/gcc.target/vax/pr56875.c b/gcc/testsuite/gcc.target/vax/pr56875.c
index f409afe88e7..191e05e166e 100644
--- a/gcc/testsuite/gcc.target/vax/pr56875.c
+++ b/gcc/testsuite/gcc.target/vax/pr56875.c
@@ -1,13 +1,10 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O0" } */
+/* { dg-options "" } */
 /* { dg-final { scan-assembler     "ashq .*,\\\$0xffffffffffffffff," } } */
 /* { dg-final { scan-assembler-not "ashq .*,\\\$-1," } } */
 
-void
-a (void)
+unsigned long long
+a (unsigned long i)
 {
-	unsigned long i = 1;
-	unsigned long long v;
-
-	v = ~ (unsigned long long) 0 << i;
+  return ~(unsigned long long) 0 << i;
 }
diff --git a/gcc/testsuite/gcc.target/vax/vax.exp b/gcc/testsuite/gcc.target/vax/vax.exp
index 4f480559e12..678e9007686 100644
--- a/gcc/testsuite/gcc.target/vax/vax.exp
+++ b/gcc/testsuite/gcc.target/vax/vax.exp
@@ -34,7 +34,7 @@  if ![info exists DEFAULT_CFLAGS] then {
 dg-init
 
 # Main loop.
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
 	"" $DEFAULT_CFLAGS
 
 # All done.