[PATCH][arm] PR target/65578: Fix builtin-bswap16-1.c and builtin-bswap-1.c

Kyrill Tkachov kyrylo.tkachov@foss.arm.com
Thu Jan 18 09:26:00 GMT 2018


Hi all,

The builtin-bswap-1.c and builtin-bswap16-1.c are pretty annoying at the moment.
They force an explicit armv6 option that is a thumb1 target, so if you're testing a toolchain
configured with something like --with-cpu=cortex-a15 --with-float=hard --with-mode=thumb
you'll get those pesky errors about Thumb1 hard-float not being implemented, even though
the tests don't relate to floating-point functionality at all. I *think* this is also due
to the wrong order of dg-options and dg-require-effective-target directives that might
end up not doing a proper effective target check.

The solution in this patch is to commonise the code and create a couple of tests for each.
One tests an armv6t2 target. This allows us to test an ARM or a Thumb2 target.
The second one sets an armv6-m target, which is a Thumb1 target.
The dg-add-options machinery for arm_arch_v6m knows how to add the right -mfloat-abi=soft option.

With this patch we end up testing all of ARM, Thumb1, Thumb2 codegen whereas before we only
ever tried testing Thumb1, if the multilib options happened to line up just right, and would
give an ugly error otherwise.  Now, if the multilib options don't allow the test it should just
appear as UNSUPPORTED.

Committing to trunk.

Thanks,
Kyrill

2018-01-18  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     PR target/65578
     * gcc.target/arm/builtin-bswap.x: New file.
     * gcc.target/arm/builtin-bswap-1.c: Include the above.  Add checks
     and options for armv6t2.
     * gcc.target/arm/builtin-bswap-2.c: Include the above.  Add checks
     and options for Thumb1.
     * gcc.target/arm/builtin-bswap16.x: New file.
     * gcc.target/arm/builtin-bswap16-1.c: Include the above.  Add checks
     and options for armv6t2.
     * gcc.target/arm/builtin-bswap16-2.c: Include the above.  Add checks
     and options for Thumb1.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-test-bswap.patch
Type: text/x-patch
Size: 6292 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180118/fc3c8cd2/attachment.bin>


More information about the Gcc-patches mailing list