diff mbox

[testsuite] New effective target long_neq_int

Message ID 1344563196.18792.15.camel@gnopaine
State New
Headers show

Commit Message

Bill Schmidt Aug. 10, 2012, 1:46 a.m. UTC
As suggested by Janis regarding testsuite/gcc.dg/tree-ssa/slsr-30.c,
this patch adds a new effective target for machines having long and int
of differing sizes.

Tested on powerpc64-unknown-linux-gnu, where the test passes for -m64
and is skipped for -m32.  Ok for trunk?

Thanks,
Bill


doc:

2012-08-09  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* sourcebuild.texi: Document long_neq_int effective target.


testsuite:

2012-08-09  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* lib/target-supports.exp (check_effective_target_long_neq_int): New.
	* gcc.dg/tree-ssa/slsr-30.c: Check for long_neq_int effective target.

Comments

Janis Johnson Aug. 10, 2012, 4:48 a.m. UTC | #1
On 08/09/2012 06:46 PM, William J. Schmidt wrote:
> As suggested by Janis regarding testsuite/gcc.dg/tree-ssa/slsr-30.c,
> this patch adds a new effective target for machines having long and int
> of differing sizes.
> 
> Tested on powerpc64-unknown-linux-gnu, where the test passes for -m64
> and is skipped for -m32.  Ok for trunk?

OK!

Janis

> Thanks,
> Bill
> 
> 
> doc:
> 
> 2012-08-09  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
> 
> 	* sourcebuild.texi: Document long_neq_int effective target.
> 
> 
> testsuite:
> 
> 2012-08-09  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
> 
> 	* lib/target-supports.exp (check_effective_target_long_neq_int): New.
> 	* gcc.dg/tree-ssa/slsr-30.c: Check for long_neq_int effective target.
> 
> 
> Index: gcc/doc/sourcebuild.texi
> ===================================================================
> --- gcc/doc/sourcebuild.texi	(revision 190260)
> +++ gcc/doc/sourcebuild.texi	(working copy)
> @@ -1303,6 +1303,9 @@ Target has @code{int} that is at 32 bits or longer
>  @item int16
>  Target has @code{int} that is 16 bits or shorter.
>  
> +@item long_neq_int
> +Target has @code{int} and @code{long} with different sizes.
> +
>  @item large_double
>  Target supports @code{double} that is longer than @code{float}.
>  
> Index: gcc/testsuite/lib/target-supports.exp
> ===================================================================
> --- gcc/testsuite/lib/target-supports.exp	(revision 190260)
> +++ gcc/testsuite/lib/target-supports.exp	(working copy)
> @@ -1689,6 +1689,15 @@ proc check_effective_target_llp64 { } {
>      }]
>  }
>  
> +# Return 1 if long and int have different sizes,
> +# 0 otherwise.
> +
> +proc check_effective_target_long_neq_int { } {
> +    return [check_no_compiler_messages long_ne_int object {
> +	int dummy[sizeof (int) != sizeof (long) ? 1 : -1];
> +    }]
> +}
> +
>  # Return 1 if the target supports long double larger than double,
>  # 0 otherwise.
>  
> Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c	(revision 190260)
> +++ gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c	(working copy)
> @@ -1,7 +1,7 @@
>  /* Verify straight-line strength reduction fails for simple integer addition
>     with casts thrown in when -fwrapv is used.  */
>  
> -/* { dg-do compile { target { ! { ilp32 } } } } */
> +/* { dg-do compile { target { long_neq_int } } } */
>  /* { dg-options "-O3 -fdump-tree-dom2 -fwrapv" } */
>  
>  long
> 
>
diff mbox

Patch

Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi	(revision 190260)
+++ gcc/doc/sourcebuild.texi	(working copy)
@@ -1303,6 +1303,9 @@  Target has @code{int} that is at 32 bits or longer
 @item int16
 Target has @code{int} that is 16 bits or shorter.
 
+@item long_neq_int
+Target has @code{int} and @code{long} with different sizes.
+
 @item large_double
 Target supports @code{double} that is longer than @code{float}.
 
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 190260)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -1689,6 +1689,15 @@  proc check_effective_target_llp64 { } {
     }]
 }
 
+# Return 1 if long and int have different sizes,
+# 0 otherwise.
+
+proc check_effective_target_long_neq_int { } {
+    return [check_no_compiler_messages long_ne_int object {
+	int dummy[sizeof (int) != sizeof (long) ? 1 : -1];
+    }]
+}
+
 # Return 1 if the target supports long double larger than double,
 # 0 otherwise.
 
Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c	(revision 190260)
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c	(working copy)
@@ -1,7 +1,7 @@ 
 /* Verify straight-line strength reduction fails for simple integer addition
    with casts thrown in when -fwrapv is used.  */
 
-/* { dg-do compile { target { ! { ilp32 } } } } */
+/* { dg-do compile { target { long_neq_int } } } */
 /* { dg-options "-O3 -fdump-tree-dom2 -fwrapv" } */
 
 long