[PATCH] prepare testsuite for -Wmain fixes
Dirk Mueller
dmueller@suse.de
Thu Mar 29 22:40:00 GMT 2007
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" } } */
More information about the Gcc-patches
mailing list