This resolves the test failure for armv8.1-m.main with -mfloat-abi=hard.

The size 36 is just the size that r16-7687-g772499fd7e2f9a produced
and using it allows us to notice if there will be a regression.

Ok for trunk?

--

The test case is only an assemble test, thus no need for hw.

Remove check_effective_target_arm_thumb2_no_arm_v8_1m_lob and
check_effective_target_arm_thumb2_ok_no_arm_v8_1m_lob as they are no
longer referenced.

Add check to ivopts.c that validates size in case LOB is available.

gcc/testsuite/ChangeLog:

        * lib/target-supports.exp
        (check_effective_target_arm_v8_1m_lob): New function.
        (check_effective_target_arm_thumb2_no_arm_v8_1m_lob): Remove.
        (check_effective_target_arm_thumb2_ok_no_arm_v8_1m_lob): Remove.
        * gcc.target/arm/ivopts.c: Use effective target arm_v8_1m_lob.

Signed-off-by: Torbjörn SVENSSON <[email protected]>
---
 gcc/testsuite/gcc.target/arm/ivopts.c |  3 ++-
 gcc/testsuite/lib/target-supports.exp | 39 +++++++++++++--------------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/ivopts.c 
b/gcc/testsuite/gcc.target/arm/ivopts.c
index 6e3e74c2d56..44d6cf8d458 100644
--- a/gcc/testsuite/gcc.target/arm/ivopts.c
+++ b/gcc/testsuite/gcc.target/arm/ivopts.c
@@ -11,5 +11,6 @@ tr5 (short array[], int n)
 }
 
 /* { dg-final { scan-tree-dump-times "PHI <" 1 "ivopts"} } */
-/* { dg-final { object-size text <= 20 { target { arm_thumb2_no_arm_v8_1m_lob 
} } } } */
+/* { dg-final { object-size text <= 20 { target { arm_thumb2 && { ! 
arm_v8_1m_lob } } } } } */
+/* { dg-final { object-size text <= 36 { target { arm_thumb2 && arm_v8_1m_lob 
} } } } */
 /* { dg-final { object-size text <= 32 { target { arm_nothumb } } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index 212ec081e99..1dbd9b62345 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -13954,29 +13954,26 @@ proc check_effective_target_arm_v8_1m_lob_hw { } {
     }
 }
 
-# Return 1 if this is an ARM target where Thumb-2 is used without
-# options added by the test and the target does not support executing
-# the Armv8.1-M Mainline Low Overhead Loop, 0 otherwise.  The test is
-# valid for ARM.
-
-proc check_effective_target_arm_thumb2_no_arm_v8_1m_lob { } {
-    if { [check_effective_target_arm_thumb2]
-        && ![check_effective_target_arm_v8_1m_lob_hw] } {
-       return 1
-    }
-    return 0
-}
-
-# Return 1 if this is an ARM target where -mthumb causes Thumb-2 to be
-# used and the target does not support executing the Armv8.1-M
-# Mainline Low Overhead Loop, 0 otherwise.  The test is valid for ARM.
+# Return 1 if the target supports the Armv8.1-M Mainline Low
+# Overhead Loop, 0 otherwise.  The test is valid for ARM.
 
-proc check_effective_target_arm_thumb2_ok_no_arm_v8_1m_lob { } {
-    if { [check_effective_target_arm_thumb2_ok]
-        && ![check_effective_target_arm_v8_1m_lob_hw] } {
-       return 1
+proc check_effective_target_arm_v8_1m_lob { } {
+    if { ![check_effective_target_arm_cortex_m] } {
+       return 0;
+    } else {
+       return [check_no_compiler_messages arm_v8_1m_lob_available object {
+               int
+               main (void)
+               { int i = 0;
+                 asm  ("movw r3, #10\n\t" /* movs? */
+                       "dls lr, r3" : : : "r3", "lr");
+                loop:
+                 i++;
+                 asm goto ("le lr, %l0" : : : "lr" : loop);
+                 return i != 10;
+               }
+       } "" ]
     }
-    return 0
 }
 
 # Returns 1 if the target is using glibc, 0 otherwise.
-- 
2.43.0

Reply via email to