[PATCH, testsuite] MIPS: Skip msa-builtins-err.c if there is no assembly output.

Toma Tabacu Toma.Tabacu@imgtec.com
Mon Dec 12 13:50:00 GMT 2016


> 
> It's a shame this is the only way to deal with this but I see aarch64 have
> to resort to the same thing for error checking tests.
> 

I have looked into this some more and I 've found that the solution I proposed
is incomplete.

The problem is that if no linker plugin is found, -fno-fat-lto-objects is not
passed on, so the test isn't skipped and it will fail because -flto doesn't do
assembly generation by default and the errors will not be triggered.

This can be fixed by adding -ffat-lto-objects as a test option for error tests,
as shown in the patch below.

The thing is, this already happens for scan-assembler & friends
behind-the-scenes, but not for dg-error, because the former are run through
force_conventional_output, while the latter is not.

A nicer solution would be to have a new directive which would do nothing except
for the force_conventional_output part, thus forcing assembly generation,
but this may be overkill.

Regards,
Toma

gcc/testsuite/ChangeLog:

	* gcc.target/mips/msa-builtins-err.c (dg-options): Use
	 -ffat-lto-objects to guarantee assembly generation.

diff --git a/gcc/testsuite/gcc.target/mips/msa-builtins-err.c b/gcc/testsuite/gcc.target/mips/msa-builtins-err.c
index 041b7f5..68244d6 100644
--- a/gcc/testsuite/gcc.target/mips/msa-builtins-err.c
+++ b/gcc/testsuite/gcc.target/mips/msa-builtins-err.c
@@ -1,6 +1,8 @@
 /* Test builtins for MIPS MSA ASE instructions */
 /* { dg-do compile } */
-/* { dg-options "-mfp64 -mhard-float -mmsa" } */
+/* { dg-options "-mfp64 -mhard-float -mmsa -ffat-lto-objects" } */
+/* Because this test only uses dg-error, we need to guarantee assembly
+   generation ourselves by using -ffat-lto-objects. */
 
 #include <msa.h>



More information about the Gcc-patches mailing list