Add arm_thumb1_ok effective-target for g++.dg/inherit/thunk8.C

View: New views
2 Messages — Rating Filter:   Alert me  

Add arm_thumb1_ok effective-target for g++.dg/inherit/thunk8.C

by Joseph S. Myers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The testcase g++.dg/inherit/thunk8.C tests for a specifically Thumb-1
bug by scanning the assembly output for text generated for Thumb-1
after the fix for that bug.

As such, this testcase only makes sense for Thumb-1.  At present, it
requires the arm32 effective-target and passes -mthumb.  The arm32
effective target means it *doesn't* run for plain Thumb-1 multilibs,
while it does run and fail for Thumb-2 multilibs, or ARMv7 multilibs
where -mthumb means Thumb-2.

This patch adds an effective target to describe where this test should
run: any ARM or Thumb multilib where -mthumb means Thumb-1.  OK to
commit?

2008-07-24  Joseph Myers  <joseph@...>

        * lib/target-supports.exp (check_effective_target_arm_thumb1_ok):
        New.
        * g++.dg/inherit/thunk8.C: Use it.

Index: g++.dg/inherit/thunk8.C
===================================================================
--- g++.dg/inherit/thunk8.C (revision 138097)
+++ g++.dg/inherit/thunk8.C (working copy)
@@ -3,7 +3,7 @@
    Make sure that won't happen anymore.  */
 
 /* { dg-do compile } */
-/* { dg-require-effective-target arm32 } */
+/* { dg-require-effective-target arm_thumb1_ok } */
 /* { dg-options "-mthumb -fPIC" } */
 
 struct A {
Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp (revision 138097)
+++ lib/target-supports.exp (working copy)
@@ -1249,6 +1249,17 @@
     }
 }
 
+# Return 1 is this is an ARM target where -mthumb causes Thumb-1 to be
+# used.
+
+proc check_effective_target_arm_thumb1_ok { } {
+    return [check_no_compiler_messages arm_thumb1_ok assembly {
+ #if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__)
+ #error FOO
+ #endif
+    } "-mthumb"]
+}
+
 # Return 1 if the target supports executing NEON instructions, 0
 # otherwise.  Cache the result.
 

--
Joseph S. Myers
joseph@...

Re: Add arm_thumb1_ok effective-target for g++.dg/inherit/thunk8.C

by Paul Brook :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 2008-07-24  Joseph Myers  <joseph@...>
>
> * lib/target-supports.exp (check_effective_target_arm_thumb1_ok):
> New.
> * g++.dg/inherit/thunk8.C: Use it.


Looks ok to me.

Paul