Commit 90fe9afd by Jason Merrill

re PR tree-optimization/14107 (Return warnings don't work without optimizations enabled)

        PR tree-optimization/14107
        * decl.c (finish_function): Warn about no return in all functions.

From-SVN: r83316
parent 401844ef
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
struct struct00 { }; struct struct00 { };
int global_function_0 () { int global_function_0 () {
} // { dg-error "" "" { xfail *-*-* } } } // { dg-error "" }
struct00 global_function_1 () { struct00 global_function_1 () {
} // { dg-error "" "" { xfail *-*-* } } } // { dg-error "" }
struct struct0 { struct struct0 {
...@@ -41,9 +41,9 @@ struct struct1 { ...@@ -41,9 +41,9 @@ struct struct1 {
}; };
int struct1_member_function_0 () { int struct1_member_function_0 () {
} // { dg-error "" "" { xfail *-*-* } } } // { dg-error "" }
struct1 struct1::struct1_member_function_1 () { struct1 struct1::struct1_member_function_1 () {
} // { dg-error "" "" { xfail *-*-* } } } // { dg-error "" }
int main () { return 0; } int main () { return 0; }
// { dg-do assemble } // { dg-do assemble }
// { dg-options "-Wno-deprecated -Wreturn-type" } // { dg-options "-Wno-deprecated -Wreturn-type" }
//
// GROUPS passed i960 // GROUPS passed i960
/* /*
Bug Id: bnr Bug Id: bnr
...@@ -102,7 +101,7 @@ warn_return_1 () ...@@ -102,7 +101,7 @@ warn_return_1 ()
{ {
foo f; foo f;
printf ("returning 1\n"); printf ("returning 1\n");
} // { dg-warning "" "" { xfail *-*-* } } control reaches end } // { dg-warning "" } control reaches end
int int
warn_return_arg (int arg) warn_return_arg (int arg)
...@@ -110,7 +109,7 @@ warn_return_arg (int arg) ...@@ -110,7 +109,7 @@ warn_return_arg (int arg)
foo f; foo f;
printf ("returning %d\n", arg); printf ("returning %d\n", arg);
arg; arg;
} // { dg-warning "" "" { xfail *-*-* } } control reaches end } // { dg-warning "" } control reaches end
int int
warn_return_sum (int x, int y) warn_return_sum (int x, int y)
...@@ -118,20 +117,20 @@ warn_return_sum (int x, int y) ...@@ -118,20 +117,20 @@ warn_return_sum (int x, int y)
foo f; foo f;
printf ("returning %d+%d\n", x, y); printf ("returning %d+%d\n", x, y);
x + y; x + y;
} // { dg-warning "" "" { xfail *-*-* } } control reaches end } // { dg-warning "" } control reaches end
foo foo
warn_return_foo () warn_return_foo ()
{ {
foo f; foo f;
printf ("returning foo\n"); printf ("returning foo\n");
} // { dg-warning "" "" { xfail *-*-* } } control reaches end } // { dg-warning "" } control reaches end
foo foo
warn_foo_parm_returns_foo (foo f) warn_foo_parm_returns_foo (foo f)
{ {
f; f;
} // { dg-warning "" "" { xfail *-*-* } } control reaches end } // { dg-warning "" } control reaches end
main () main ()
{ // { dg-warning "" } no type { // { dg-warning "" } no type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment