Hi,
Attached is a patch to disable 20021018.c if the sizeof (int) < 4.
On h8300, the user can choose the sizeof (int) to be either 2 or 4.
When sizeof (int) == 2, the testcase fails because an integer that
does not fit in 2 bytes is passed as an int argument.
The patch also removes the dg-error line because #if should take care
of everything on xstormy16 as well.
Tested on h8300 port. OK to apply?
Kazu Hirata
2003-07-05 Kazu Hirata <kazu@cs.umass.edu>
* gcc.dg/20021018-1.c: Disable if the sizeof (int) < 4.
Index: 20021018-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/20021018-1.c,v
retrieving revision 1.2
diff -u -r1.2 20021018-1.c
--- 20021018-1.c 8 May 2003 23:38:04 -0000 1.2
+++ 20021018-1.c 5 Jul 2003 18:18:28 -0000
@@ -1,10 +1,10 @@
/* { dg-do run } */
/* { dg-options "-O2 -fpic" } */
-/* { dg-error "overflow" "16-bit target" { target xstormy16-*-* } 0 } */
extern void abort (void);
extern void exit (int);
+#if __INT_MAX__ >= 2147483647L
static const long foo [10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
long __attribute__((noinline))
@@ -20,3 +20,10 @@
abort ();
exit (0);
}
+#else
+int
+main (void)
+{
+ exit (0);
+}
+#endif