Hi,

I'm resurrecting a patch I posted in 2012-09 :)

effective_target_arm_arch_FUNC_ok currently contains only
                #if !defined (DEF)
                #error FOO
                #endif
which is not sufficient for GCC to complain in case of an
unsupported flags combination.
For instance, -mfloat-abi=hard -mthumb -march=armv5te leads to:
sorry, unimplemented: Thumb-1 hard-float VFP ABI
but only if the compiler had actual code to compile.

Adding a dummy main() body in the arm_arch_FUNC_ok
effective target does the trick: with this patch, this effective
target test would fail, making the test unsupported rather
than failing later.

OK?

Christophe
2018-01-18  Christophe Lyon <christophe.l...@linaro.org>

        gcc/testsuite:
        * lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok):
        Add function body to force error messages in some configurations.

diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index f597316..bc7d451 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2211,6 +2211,11 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 
-marm" __ARM_ARCH_4__
                #if !defined (DEF)
                #error FOO
                #endif
+               int
+               main (void)
+               {
+                   return 0;
+               }
            } "FLAG" ]
        }
 

Reply via email to