Patchwork [testsuite] Tweak gcc.c-torture/execute/20101011-1.c

login
register
mail settings
Submitter Kaz Kojima
Date Oct. 26, 2010, 10:50 p.m.
Message ID <20101027.075058.131725915.kkojima@rr.iij4u.or.jp>
Download mbox | patch
Permalink /patch/69304/
State New
Headers show

Comments

Kaz Kojima - Oct. 26, 2010, 10:50 p.m.
Hi,

The patch below adds the SH case to the recently added test
gcc.c-torture/execute/20101011-1.c, because SH doesn't trap
with integral division by zero.
The second hunk of the patch changes #ifdef to #if to avoid
an undeclared error for sigfpe which is seen on SH and
powerpc-apple-darwin9.8.0.
Ok for trunk?

Regards,
	kaz
--
2010-10-26  Kaz Kojima  <kkojima@gcc.gnu.org>

	* gcc.c-torture/execute/20101011-1.c: Skip on SH.
	Use #if instead of #ifdef.

Patch

--- ORIG/trunk/gcc/testsuite/gcc.c-torture/execute/20101011-1.c	2010-10-25 12:47:18.000000000 +0900
+++ trunk/gcc/testsuite/gcc.c-torture/execute/20101011-1.c	2010-10-25 19:57:58.000000000 +0900
@@ -9,6 +9,9 @@ 
 #elif defined (__SPU__)
   /* On SPU division by zero does not trap.  */
 # define DO_TEST 0
+#elif defined (__sh__)
+  /* On SH division by zero does not trap.  */
+# define DO_TEST 0
 #else
 # define DO_TEST 1
 #endif
@@ -35,7 +38,7 @@  int k;
 int
 main ()
 {
-#ifdef DO_TEST
+#if DO_TEST
   signal (SIGFPE, sigfpe);
   k = i / j;
   abort ();