OSDN Git Service

* gcc.c-torture/compile/20010114-1.c: New test.
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 14 Jan 2001 11:38:49 +0000 (11:38 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 14 Jan 2001 11:38:49 +0000 (11:38 +0000)
* gcc.c-torture/compile/20010114-1.x: Xfail.
* gcc.c-torture/compile/20010114-2.c: New test.
* gcc.c-torture/execute/20010114-1.c: New test.
* gcc.dg/trunc-1.c: New test.
* gcc.dg/uninit-B.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39009 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20010114-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/20010114-1.x [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/20010114-2.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/20010114-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/trunc-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/uninit-B.c [new file with mode: 0644]

index e5a6800..1a1d3f7 100644 (file)
@@ -1,3 +1,12 @@
+2001-01-14  Joseph S. Myers  <jsm28@cam.ac.uk>
+
+       * gcc.c-torture/compile/20010114-1.c: New test.
+       * gcc.c-torture/compile/20010114-1.x: Xfail.
+       * gcc.c-torture/compile/20010114-2.c: New test.
+       * gcc.c-torture/execute/20010114-1.c: New test.
+       * gcc.dg/trunc-1.c: New test.
+       * gcc.dg/uninit-B.c: New test.
+
 2001-01-13  Nick Clifton  <nickc@redhat.com>
 
        * gcc.c-torture/execute/bf64-1.x: Expect to fail on M*Core
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010114-1.c b/gcc/testsuite/gcc.c-torture/compile/20010114-1.c
new file mode 100644 (file)
index 0000000..9b608aa
--- /dev/null
@@ -0,0 +1,5 @@
+/* Origin: PR c/166 from Joerg Czeranski <jc@joerch.org>.  */
+/* In the declaration of proc, x cannot be parsed as a typedef name,
+   so it must be parsed as a parameter name.  */
+typedef int x;
+void proc(int (*x)(void)) {}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010114-1.x b/gcc/testsuite/gcc.c-torture/compile/20010114-1.x
new file mode 100644 (file)
index 0000000..f41cdc2
--- /dev/null
@@ -0,0 +1,2 @@
+set torture_compile_xfail "*-*-*"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010114-2.c b/gcc/testsuite/gcc.c-torture/compile/20010114-2.c
new file mode 100644 (file)
index 0000000..75f5ea2
--- /dev/null
@@ -0,0 +1,6 @@
+/* Origin: <URL:http://gcc.gnu.org/ml/gcc-patches/2000-12/msg01384.html>
+   from Fred Fish <fnf@geekgadgets.org>.  See also PR c/1625.  */
+
+#include <stdbool.h>
+
+struct { int x; bool y; } foo = { 0, false };
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010114-1.c b/gcc/testsuite/gcc.c-torture/execute/20010114-1.c
new file mode 100644 (file)
index 0000000..ee8295e
--- /dev/null
@@ -0,0 +1,15 @@
+/* Origin: PR c/1540 from Mattias Lampe <lampe@tu-harburg.de>,
+   adapted to a testcase by Joseph Myers <jsm28@cam.ac.uk>.
+   GCC 2.95.2 fails, CVS GCC of 2001-01-13 passes.  */
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+  int array1[1] = { 1 };
+  int array2[2][1]= { { 1 }, { 0 } };
+  if (array1[0] != 1)
+    abort ();
+  exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/trunc-1.c b/gcc/testsuite/gcc.dg/trunc-1.c
new file mode 100644 (file)
index 0000000..0d6a48b
--- /dev/null
@@ -0,0 +1,15 @@
+/* Origin: PR c/675 from aj@suse.de.  */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+#include <stddef.h>
+
+int
+main (void)
+{
+  size_t len;
+
+  len = ~(sizeof (size_t) - 1); /* { dg-bogus "truncated" "bogus truncation warning" } */
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-B.c b/gcc/testsuite/gcc.dg/uninit-B.c
new file mode 100644 (file)
index 0000000..450bb38
--- /dev/null
@@ -0,0 +1,15 @@
+/* Origin: PR c/179 from Gray Watson <gray@256.com>, adapted as a testcase
+   by Joseph Myers <jsm28@cam.ac.uk>.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+extern void foo (int *);
+extern void bar (int);
+
+void
+baz (void)
+{
+  int i;
+  if (i) /* { dg-warning "uninit" "uninit i warning" { xfail *-*-* } } */
+    bar (i);
+  foo (&i);
+}