This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] prepare testsuite for -Wmain fixes
- From: Dirk Mueller <dmueller at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jeffrey Law <law at redhat dot com>
- Date: Thu, 29 Mar 2007 23:58:36 +0200
- Subject: [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" } } */