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]
Other format: [Raw text]

[PATCH] prepare testsuite for -Wmain fixes


Hi, 

In preparation of -Wmain I've noticed that gcc.dg/tree-ssa/reassoc-3.c
would now trigger the warning due to invalid parameters being passed 
to "main". 

The easiest way to fix this is to not run it and not compile it with default 
(-pedantic) flags. 

Patch regtested fine. Optionally I could rename the function to some other 
name than main to avoid future similar issues.


2007-03-29   Dirk Mueller  <dmueller@suse.de>

        * gcc.dg/tree-ssa/reassoc-3.c: Only compile
        the testcase and check optimized dump.

--- gcc.dg/tree-ssa/reassoc-3.c
+++ gcc.dg/tree-ssa/reassoc-3.c
@@ -1,6 +1,12 @@
+/* { dg-do compile } */ 
+/* { dg-options "-O2 -fdump-tree-optimized" } */
 int main(int a, int b, int c, int d)
 {
   int e = (a & ~b) & (~c & d);
   int f = (~c & a) & (b & ~d);
- return (e & f);
+  /* We should be able to transform this into return 0  */
+  return (e & f);
 }
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */


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