Message ID | CAKdteOa-G126JHziuQ8ZxF=jBOwKypvFgrLmat1aya4ZVkhJEg@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | [ARM,testsuite] Make arm_arch_FUNC_ok more robust | expand |
Hi Christophe, On 18/01/18 14:08, Christophe Lyon wrote: > Hi, > > I'm resurrecting a patch I posted in 2012-09 :) > That's the month I first started working on GCC :) > 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? Ok. The arm_<target>_ok checks should really be able to tell us that we can at least get to an assembly result if we add the option in question. The quirk with the Thumb1 hard-float error is that it only appears when compiling a function, because it's part of the ABI-conformance code that picks where to put the result and arguments of a function. If we have a source-file that only checks preprocessor macros it will not trigger. Anyway, thanks for sending this, it will clean up some ugly FAILs in arm.exp. Kyrill > > Christophe
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" ] }