public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, testsuit] Add tests for PR33009
@ 2008-03-03 13:38 Gabor Loki
  2008-03-05  2:19 ` Ian Lance Taylor
  2008-03-07 19:50 ` David Daney
  0 siblings, 2 replies; 5+ messages in thread
From: Gabor Loki @ 2008-03-03 13:38 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

Hi,

This patch adds some trivial checks for -frtl-abstract-sequences.
Inspired by PR33009.

Ok for trunk?

--Gabor


2007-03-03  Gabor Loki  <loki@gcc.gnu.org>

	PR 33009
	* gcc.c-torture/compile/pr11832.c: Check -frtl-abstract-sequences.
	* gcc.c-torture/compile/pr33009.c: Likewise.



[-- Attachment #2: PR33009-test.patch --]
[-- Type: text/x-patch, Size: 1722 bytes --]

Index: gcc/testsuite/gcc.c-torture/compile/pr33009.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr33009.c	(revision 0)
+++ gcc/testsuite/gcc.c-torture/compile/pr33009.c	(revision 0)
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-frtl-abstract-sequences" } */
+
+char *progName;
+int bar0 (char *, ...);
+void bar1 (char *);
+void exit (int);
+
+
+#define SAME \
+ bar0 ("%s: Bad flag `%s'\n", argv[i], argv[i] );\
+ bar1 ( progName ); \
+ exit ( 1 );
+
+
+int foo ( int argc, char *argv[] )
+{
+    int i;
+    for (i = 0; i < argc; i++) {
+	switch (argv[i][0]) {
+	case 'c':
+	    break;
+	default: 
+	
+	    SAME
+	    
+	    break;
+	}
+    }
+    for (i = 0; i < argc; i++) {
+    
+	SAME
+	
+    }
+    return 0;
+}
Index: gcc/testsuite/gcc.c-torture/compile/pr11832.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr11832.c	(revision 0)
+++ gcc/testsuite/gcc.c-torture/compile/pr11832.c	(revision 0)
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-frtl-abstract-sequences" } */
+
+int a, b, e;
+unsigned char *c;
+void foo()
+{
+  int d = 13;
+  b = -1;   
+  switch (e) {
+    case 1:
+      b++; c[b] = (unsigned char)d;
+      break;
+    case 2:
+      b++; c[b] = (unsigned char)d;
+      b++; c[b] = (unsigned char)d;
+      break;
+    case 3:
+      b++; c[b] = (unsigned char)d;
+      b++; c[b] = (unsigned char)d;
+      b++; c[b] = (unsigned char)d;
+      break;
+    default:
+      a = 1;
+      b++; c[b] = (unsigned char)d;
+      b++; c[b] = (unsigned char)d;
+      b++; c[b] = (unsigned char)d;
+      b++; c[b] = (unsigned char)d;
+  }
+}



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-11  9:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-03 13:38 [PATCH, testsuit] Add tests for PR33009 Gabor Loki
2008-03-05  2:19 ` Ian Lance Taylor
2008-03-11  5:53   ` David Daney
2008-03-11  9:51     ` Gabor Loki
2008-03-07 19:50 ` David Daney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).