This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A couple of testcases from GNATS


This patch adds a couple of XFAILing test cases, taken from the GNATS
database.

2000-08-01  Joseph S. Myers  <jsm28@cam.ac.uk>

	* gcc.c-torture/execute/20000801-3.c, gcc.c-torture/20000801-4.c:
	New tests.
	* gcc.c-torture/execute/20000801-3.x, gcc/c-torture/20000801-4.x:
	Xfail.

--- gcc.c-torture/execute/20000801-3.c.orig	Thu Jan  1 00:00:00 1970
+++ gcc.c-torture/execute/20000801-3.c	Tue Aug  1 19:03:23 2000
@@ -0,0 +1,24 @@
+/* Origin: PR c/92 from Simon Marlow <t-simonm@microsoft.com>, adapted
+   to a testcase by Joseph Myers <jsm28@cam.ac.uk>.
+*/
+
+typedef struct { } empty;
+
+typedef struct {
+  int i;
+  empty e;
+  int i2;
+} st;
+
+st s = { .i = 0, .i2 = 1 };
+
+extern void abort (void);
+
+int
+main (void)
+{
+  if (s.i2 == 1)
+    return 0;
+  else
+    abort ();
+}
--- gcc.c-torture/execute/20000801-3.x.orig	Thu Jan  1 00:00:00 1970
+++ gcc.c-torture/execute/20000801-3.x	Tue Aug  1 19:04:52 2000
@@ -0,0 +1,2 @@
+set torture_execute_xfail "*-*-*"
+return 0
--- gcc.c-torture/execute/20000801-4.c.orig	Thu Jan  1 00:00:00 1970
+++ gcc.c-torture/execute/20000801-4.c	Tue Aug  1 19:03:27 2000
@@ -0,0 +1,27 @@
+/* Origin: PR c/128 from Martin Sebor <sebor@roguewave.com>, adapted
+   as a testcase by Joseph Myers <jsm28@cam.ac.uk>.
+*/
+/* Character arrays initialised by a string literal must have
+   uninitialised elements zeroed.  This isn't clear in the 1990
+   standard, but was fixed in TC2 and C99; see DRs #060, #092.
+*/
+extern void abort (void);
+
+int
+foo (void)
+{
+  char s[2] = "";
+  return 0 == s[1];
+}
+
+int
+main (void)
+{
+  {
+    char s[] = "x";
+  }
+  if (foo ())
+    return 0;
+  else
+    abort ();
+}
--- gcc.c-torture/execute/20000801-4.x.orig	Thu Jan  1 00:00:00 1970
+++ gcc.c-torture/execute/20000801-4.x	Tue Aug  1 19:05:04 2000
@@ -0,0 +1,2 @@
+set torture_execute_xfail "*-*-*"
+return 0

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]