This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
New test for negative case labels
- To: gcc-patches at gcc dot gnu dot org
- Subject: New test for negative case labels
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 06 Jan 2001 21:15:26 -0200
- Organization: GCC Team, Red Hat
I'm checking in this new test. Apparently, none of the existing tests
catches this failure. I was doing an unsigned compare of the case
table bounds in a new port.
Index: gcc/testsuite/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* gcc.c-torture/execute/20010106-1.c: New test.
Index: gcc/testsuite/gcc.c-torture/execute/20010106-1.c
===================================================================
RCS file: 20010106-1.c
diff -N 20010106-1.c
--- /dev/null Tue May 5 13:32:27 1998
+++ gcc/testsuite/gcc.c-torture/execute/20010106-1.c Sat Jan 6 15:12:46 2001
@@ -0,0 +1,30 @@
+/* Copyright 2001 Free Software Foundation
+ Contributed by Alexandre Oliva <aoliva@redhat.com> */
+
+int f(int i) {
+ switch (i)
+ {
+ case -2:
+ return 33;
+ case -1:
+ return 0;
+ case 0:
+ return 7;
+ case 1:
+ return 4;
+ case 2:
+ return 3;
+ case 3:
+ return 15;
+ case 4:
+ return 9;
+ default:
+ abort ();
+ }
+}
+
+int main() {
+ if (f(-1))
+ abort ();
+ exit (0);
+}
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me