[arm] PR target/65578: Fix builtin-bswap16-1.c and builtin-bswap-1.c
commitef656da58f3bee3e135e6d2b55c3a0b95c7b629c
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Jan 2018 09:30:58 +0000 (18 09:30 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Jan 2018 09:30:58 +0000 (18 09:30 +0000)
treec2f03f4bfa211ae80e3804c4cf56c6dfca144b34
parenta267e499f0c81af61fdb484c6b9d1dc4af619e09
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256840 138bc75d-0d04-0410-961f-82ee72b054a4
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 [copied from gcc/testsuite/gcc.target/arm/builtin-bswap-1.c with 51% similarity]
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]