diff mbox

[testsuite] Remove -O? flags in gcc.c-torture/compile directory

Message ID 20131209142821.GD10613@virgil.suse
State New
Headers show

Commit Message

Martin Jambor Dec. 9, 2013, 2:28 p.m. UTC
Hi,

I've noticed that test testsuite/gcc.c-torture/compile/sra-1.c that I
added yeas ago is run multiple times at -O1 because that level is
specified in the test.  I looked for others such tests in that
directory and found a few more, all added by Honza :-) So this patch:

- removes the -O level specification for tests for:
   + sra-1.c - that was the intent
   + pr48929.c - PR was an ICE
   + pr39834.c - PR was an ICE, even though -Winline is involved
   + pr55569.c - PR was an ICE

- it moves test gcc.c-torture/compile/pr45085.c to gcc.dg/tree-ssa/
  because I thought that was more appropriate for a spurious warning
  problem.

- and leaves unresolved pr48641.c because it has much bigger problems.
  Not only it is tun at -O1 only but it relies on an undefined symbol
  link_error for checking.  However since the testcase is only
  compiled and not linked, it does not work.  What is worse, the
  symbol is present in the assembly output (at -O and even -O2) and so
  basically this test is currently silently failing.  Honza, perhaps
  you want to have a look?

I've checked that the modified tests pass by running them using the
RUNTESTFLAGS variable on an x86_64-linux.  OK for trunk?

Thanks,

Martin



2013-12-09  Martin Jambor  <mjambor@suse.cz>

	* gcc.c-torture/compile/pr39834.c: Remove optimization level option.
	* gcc.c-torture/compile/pr48929.c: Likewise.
	* gcc.c-torture/compile/pr55569.c: Likewise.
	* gcc.c-torture/compile/pr45085.c: Moved to...
	* gcc.dg/tree-ssa/pr45085.c: ...here, added compile dg-do.

Comments

Jakub Jelinek Dec. 9, 2013, 2:31 p.m. UTC | #1
On Mon, Dec 09, 2013 at 03:28:21PM +0100, Martin Jambor wrote:
> 2013-12-09  Martin Jambor  <mjambor@suse.cz>
> 
> 	* gcc.c-torture/compile/pr39834.c: Remove optimization level option.
> 	* gcc.c-torture/compile/pr48929.c: Likewise.
> 	* gcc.c-torture/compile/pr55569.c: Likewise.
> 	* gcc.c-torture/compile/pr45085.c: Moved to...
> 	* gcc.dg/tree-ssa/pr45085.c: ...here, added compile dg-do.

Ok, thanks.

> --- a/gcc/testsuite/gcc.c-torture/compile/sra-1.c
> +++ b/gcc/testsuite/gcc.c-torture/compile/sra-1.c
> @@ -1,5 +1,4 @@
>  /* { dg-do compile } */

You can remove also the dg-do compile line while at it.

> -/* { dg-options "-O1" } */
>  /* Let gimple verifier check what SRA does to unions and single-field
>     strucutres . */
>  

	Jakub
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39834.c b/gcc/testsuite/gcc.c-torture/compile/pr39834.c
index ecc3977..c0ad8fd 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr39834.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr39834.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O1 -Winline" } */
+/* { dg-options "-Winline" } */
 void quit_mined ();
 void bottom_line ();
 typedef enum { False, True } FLAG;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr45085.c b/gcc/testsuite/gcc.c-torture/compile/pr45085.c
deleted file mode 100644
index 5c1ec6a..0000000
--- a/gcc/testsuite/gcc.c-torture/compile/pr45085.c
+++ /dev/null
@@ -1,45 +0,0 @@ 
-/* { dg-options "-O2  -Wuninitialized" } */
-struct S { char *s1; long s2; };
-struct T { int t1; long t2; long t3; };
-extern int fn2 (void);
-extern int fn3 (struct T);
-extern struct T fn4 ();
-extern int fn5 (char **, long *, int);
-extern void fn6 (void);
-extern void fn7 (void *);
-struct S *fn10 ();
-static int p;
-static void *q;
-extern struct T r;
-
-static struct T
-fn8 (struct T x, int y)
-{
-  struct S *u = fn10 ();
-  int v = fn5 (&u->s1, &u->s2, 0);
-  while (1)
-    {
-      if (p)
-fn6 ();
-      if (fn3 (x))
-return fn4 ();
-      if (y & 1)
-return r;
-      v = fn5 (&u->s1, &u->s2, 1);
-    }
-}
-
-struct T
-fn9 (struct T x, int y)
-{
-  struct T t = fn8 (x, y);
-  if (fn2 ())
-    fn7 (q);
-  return t;
-}
-
-void *
-fn1 (void)
-{
-  return fn9;
-}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr48929.c b/gcc/testsuite/gcc.c-torture/compile/pr48929.c
index f085dc6..b28ad9d 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr48929.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr48929.c
@@ -1,4 +1,4 @@ 
-/*{ dg-options "-O  -findirect-inlining" }*/
+/*{ dg-options "-findirect-inlining" }*/
 void bar ();
 
 static void
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr55569.c b/gcc/testsuite/gcc.c-torture/compile/pr55569.c
index 2a53c80..cffbcfc 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr55569.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr55569.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O1 -ftree-vectorize" } */
+/* { dg-options "-ftree-vectorize" } */
 int *bar (void);
 
 void
diff --git a/gcc/testsuite/gcc.c-torture/compile/sra-1.c b/gcc/testsuite/gcc.c-torture/compile/sra-1.c
index 06dcf10..61cb318 100644
--- a/gcc/testsuite/gcc.c-torture/compile/sra-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/sra-1.c
@@ -1,5 +1,4 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1" } */
 /* Let gimple verifier check what SRA does to unions and single-field
    strucutres . */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr45085.c b/gcc/testsuite/gcc.dg/tree-ssa/pr45085.c
new file mode 100644
index 0000000..d95ac86
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr45085.c
@@ -0,0 +1,46 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2  -Wuninitialized" } */
+struct S { char *s1; long s2; };
+struct T { int t1; long t2; long t3; };
+extern int fn2 (void);
+extern int fn3 (struct T);
+extern struct T fn4 ();
+extern int fn5 (char **, long *, int);
+extern void fn6 (void);
+extern void fn7 (void *);
+struct S *fn10 ();
+static int p;
+static void *q;
+extern struct T r;
+
+static struct T
+fn8 (struct T x, int y)
+{
+  struct S *u = fn10 ();
+  int v = fn5 (&u->s1, &u->s2, 0);
+  while (1)
+    {
+      if (p)
+fn6 ();
+      if (fn3 (x))
+return fn4 ();
+      if (y & 1)
+return r;
+      v = fn5 (&u->s1, &u->s2, 1);
+    }
+}
+
+struct T
+fn9 (struct T x, int y)
+{
+  struct T t = fn8 (x, y);
+  if (fn2 ())
+    fn7 (q);
+  return t;
+}
+
+void *
+fn1 (void)
+{
+  return fn9;
+}