[arm] PR target/65578: Fix builtin-bswap16-1.c and builtin-bswap-1.c
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Thu, 18 Jan 2018 09:30:58 +0000 (09:30 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Thu, 18 Jan 2018 09:30:58 +0000 (09:30 +0000)
commitc5affc0451c9eb83c5142c726710cb8dbe04b66f
treec2f03f4bfa211ae80e3804c4cf56c6dfca144b34
parentf2f4f2442c02a8ea6ad0f01cebe0705c442dc816
[arm] PR target/65578: Fix builtin-bswap16-1.c and builtin-bswap-1.c

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.

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.

From-SVN: r256840
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/builtin-bswap-1.c
gcc/testsuite/gcc.target/arm/builtin-bswap-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/builtin-bswap.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/builtin-bswap16-1.c
gcc/testsuite/gcc.target/arm/builtin-bswap16-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/builtin-bswap16.x [new file with mode: 0644]