From 5ca74bbfdf2b87904ca21fcaa54952cbd1d3916c Mon Sep 17 00:00:00 2001
From: Matthew Wahab <matthew.wahab@arm.com>
Date: Wed, 28 Sep 2016 10:54:43 +0100
Subject: [PATCH] [Testsuite] Use correct effective-target settings for ARM
fp16-aapcs tests.
The recently added tests gcc.target/arm/aapcs-{3,4}.c are intended
to check the behaviour of th ARM Alternative FP16 format. They both
check for compiler support of FP16 using dg-require-effective-target
arm_fp16_ok This is too weak since the directive is true when
fp16-format=ieee is set, as it is when the +fp16 extension is
enabled.
This patch changes the directives for both tests to
dg-require-effective-target arm_fp16_alternative_ok
which is only enabled with fp16-format=alternative is set.
For fp16-aapcs-4.c, it was also neccessary to add the
-mfp16-format=alternative to the dg-options, rather than use the
arm_fp16-alternative add-options. There seems to some interaction
between the different directives and the dg-skip-if, but I can't track
it down.
Tested for cross-compiled arm-none-eabi by running the
gcc.target/arm/arm.exp testsuite on an ARMv8.2-A emulator and on an
ARMv8-A emulator.
testsuite/
2016-09-28 Matthew Wawhab <matthew.wahab@arm.com>
* gcc.target/arm/fp16-aapcs-3.c: Replace the arm_fp16_ok with
arm_fp16_alternative_ok as the required effective target.
* gcc.target/arm/fp16-aapcs-4.c: Likewise. Also add
-mfp16-format=alternative to the dg-options directive and remove
the dg-add-otions directive.
---
gcc/testsuite/gcc.target/arm/fp16-aapcs-3.c | 2 +-
gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target arm_hard_vfp_ok } */
-/* { dg-require-effective-target arm_fp16_ok } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_fp16_alternative } */
@@ -1,7 +1,6 @@
/* { dg-do compile } */
-/* { dg-require-effective-target arm_fp16_ok } */
-/* { dg-options "-mfloat-abi=softfp -O2" } */
-/* { dg-add-options arm_fp16_alternative } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
+/* { dg-options "-mfloat-abi=softfp -O2 -mfp16-format=alternative" } */
/* { dg-skip-if "incompatible float-abi" { arm*-*-* } { "-mfloat-abi=hard" } } */
/* Test __fp16 arguments and return value in registers (softfp). */
--
2.1.4