Patchwork [ARM,testsuite] Add effective target check for arm conditional execution

login
register
mail settings
Submitter Kyrylo Tkachov
Date Sept. 13, 2013, 3:25 p.m.
Message ID <52332E80.7040308@arm.com>
Download mbox | patch
Permalink /patch/274797/
State New
Headers show

Comments

Kyrylo Tkachov - Sept. 13, 2013, 3:25 p.m.
Hi all,

gcc.target/arm/minmax_minus.c is really only valid when we have 
conditional execution available, that is non Thumb1-only targets. I've 
added an effective target check for that and used it in the test so that 
it does not get run and give a false negative when testing Thumb1 targets.

Ok for trunk?

Thanks,
Kyrill

2013-09-13  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * lib/target-supports.exp (check_effective_target_arm_cond_exec):
     New procedure.
     * gcc.target/arm/minmax_minus.c: Check for cond_exec target.
Kyrylo Tkachov - Sept. 24, 2013, 1:06 p.m.
On 13/09/13 16:25, Kyrill Tkachov wrote:
> Hi all,
>
> gcc.target/arm/minmax_minus.c is really only valid when we have
> conditional execution available, that is non Thumb1-only targets. I've
> added an effective target check for that and used it in the test so that
> it does not get run and give a false negative when testing Thumb1 targets.
>
> Ok for trunk?
>
> Thanks,
> Kyrill
>
> 2013-09-13  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>       * lib/target-supports.exp (check_effective_target_arm_cond_exec):
>       New procedure.
>       * gcc.target/arm/minmax_minus.c: Check for cond_exec target.
Ping.
Mike Stump - Sept. 24, 2013, 5:12 p.m.
On Sep 13, 2013, at 8:25 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> gcc.target/arm/minmax_minus.c is really only valid when we have conditional execution available, that is non Thumb1-only targets. I've added an effective target check for that and used it in the test so that it does not get run and give a false negative when testing Thumb1 targets.
> 
> Ok for trunk?

Ok.  I was hoping the arm folks would review it, usually they are very responsive.  I'm fine with target maintainers reviewing patches like this.

Patch

diff --git a/gcc/testsuite/gcc.target/arm/minmax_minus.c b/gcc/testsuite/gcc.target/arm/minmax_minus.c
index 4c2dcdf..906342a 100644
--- a/gcc/testsuite/gcc.target/arm/minmax_minus.c
+++ b/gcc/testsuite/gcc.target/arm/minmax_minus.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-require-effective-target arm_cond_exec } */
 /* { dg-options "-O2" } */
 
 #define MAX(a, b) (a > b ? a : b)
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 0fb135c..fbe756e 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2577,6 +2577,17 @@  proc check_effective_target_arm_thumb2 { } {
     } ""]
 }
 
+# Return 1 if this is an ARM target where conditional execution is available.
+
+proc check_effective_target_arm_cond_exec { } {
+    return [check_no_compiler_messages arm_cond_exec assembly {
+	#if defined(__arm__) && defined(__thumb__) && !defined(__thumb2__)
+	#error FOO
+	#endif
+	int i;
+    } ""]
+}
+
 # Return 1 if this is an ARM cortex-M profile cpu
 
 proc check_effective_target_arm_cortex_m { } {