aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-02-10 00:53:36 +0000
committerRichard Henderson <rth@redhat.com>2004-02-10 00:53:36 +0000
commitb7916e857d82296ccb19b4b2b03cd0ea0eaa4201 (patch)
treee442c0c3a7f4cd3a917c417551a1c3c73e3ebc9f /gcc/testsuite
parentcb22cf565dd48b5cfdb66c276c6f7c6ccb38c02e (diff)
* langhooks.h (lang_hooks_for_functions): Add missing_noreturn_ok_p.
* langhooks-def.h, c-lang.c, objc/objc-lang.c (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): New. * c-objc-common.c (c_missing_noreturn_ok_p): Return bool. (c_objc_common_init): Don't set lang_missing_noreturn_ok_p. * c-tree.h (c_missing_noreturn_ok_p): Update decl. * flow.c (lang_missing_noreturn_ok_p): Remove. cp/ * cp-lang.c (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): New. * cp-tree.h (cp_missing_noreturn_ok_p): Declare. * decl.c (cp_missing_noreturn_ok_p): Export. (cxx_init_decl_processing): Don't set lang_missing_noreturn_ok_p. * flow.c (check_function_return_warnings): Move to tree-cfg.c. * toplev.c (rest_of_compilation): Don't call it. * tree-cfg.c (execute_warn_function_return): Move from flow.c, rename, update for tree vs rtl. (pass_warn_function_return): New. * tree-pass.h (pass_warn_function_return): Declare it. * tree-optimize.c (init_tree_optimization_passes): Run it. * function.h (struct function): Remove x_clobber_return_insn. * function.c (free_after_compilation): Don't set it. (expand_function_end): Likewise. testsuite/ * gcc.dg/noreturn-1.c: Adjust line numbers on warnings. * gcc.dg/noreturn-4.c: Likewise. * gcc.dg/noreturn-7.c: Likewise. Adjust warnings for changes to tail-call optimizations. * gcc.dg/return-type-3.c: Turn on optimization. * gcc.dg/uninit-6.c: Adjust line numbers on warnings. * gcc.dg/uninit-8.c: XFAIL. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@77580 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog.tree-ssa10
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-1.c7
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-7.c10
-rw-r--r--gcc/testsuite/gcc.dg/return-type-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-6.c4
-rw-r--r--gcc/testsuite/gcc.dg/uninit-8.c2
7 files changed, 25 insertions, 14 deletions
diff --git a/gcc/testsuite/ChangeLog.tree-ssa b/gcc/testsuite/ChangeLog.tree-ssa
index c98ca63083b..3209299f218 100644
--- a/gcc/testsuite/ChangeLog.tree-ssa
+++ b/gcc/testsuite/ChangeLog.tree-ssa
@@ -1,3 +1,13 @@
+2004-02-09 Richard Henderson <rth@redhat.com>
+
+ * gcc.dg/noreturn-1.c: Adjust line numbers on warnings.
+ * gcc.dg/noreturn-4.c: Likewise.
+ * gcc.dg/noreturn-7.c: Likewise. Adjust warnings for
+ changes to tail-call optimizations.
+ * gcc.dg/return-type-3.c: Turn on optimization.
+ * gcc.dg/uninit-6.c: Adjust line numbers on warnings.
+ * gcc.dg/uninit-8.c: XFAIL.
+
2004-02-09 Feng Wang <fengwang@nudt.edu.cn>
* gfortran.fortran-torture/execute/specifics.f90: Fix mod type.
diff --git a/gcc/testsuite/gcc.dg/noreturn-1.c b/gcc/testsuite/gcc.dg/noreturn-1.c
index 6e72f362bf3..90660fa028c 100644
--- a/gcc/testsuite/gcc.dg/noreturn-1.c
+++ b/gcc/testsuite/gcc.dg/noreturn-1.c
@@ -26,16 +26,17 @@ foo3(void)
extern void foo4(void);
void
foo4(void)
-{
+{ /* { dg-warning "candidate for attribute `noreturn'" "detect noreturn candidate" } */
exit(0);
-} /* { dg-warning "candidate for attribute `noreturn'" "detect noreturn candidate" } */
+}
extern void foo5(void) __attribute__ ((__noreturn__));
void
foo5(void)
{
return; /* { dg-warning "`noreturn' has a `return' statement" "detect invalid return" } */
-} /* { dg-warning "`noreturn' function does return" "detect return from noreturn" } */
+}
+/* { dg-warning "function does return" "detect return from noreturn" { target *-*-* } 37 } */
extern void foo6(void);
void
diff --git a/gcc/testsuite/gcc.dg/noreturn-4.c b/gcc/testsuite/gcc.dg/noreturn-4.c
index 4a2de5f4200..6a081b3fb4e 100644
--- a/gcc/testsuite/gcc.dg/noreturn-4.c
+++ b/gcc/testsuite/gcc.dg/noreturn-4.c
@@ -5,6 +5,6 @@ extern void exit (int) __attribute__ ((__noreturn__));
int
main (void)
-{
+{ /* { dg-warning "warning: function might be possible candidate for attribute `noreturn'" "warn for main" } */
exit (0);
-} /* { dg-warning "warning: function might be possible candidate for attribute `noreturn'" "warn for main" } */
+}
diff --git a/gcc/testsuite/gcc.dg/noreturn-7.c b/gcc/testsuite/gcc.dg/noreturn-7.c
index 1d94a7ccea5..94a26cc3875 100644
--- a/gcc/testsuite/gcc.dg/noreturn-7.c
+++ b/gcc/testsuite/gcc.dg/noreturn-7.c
@@ -14,11 +14,11 @@ void _exit(int status) __attribute__ ((__noreturn__));
int z = 0;
void g()
-{
+{ /* { dg-warning "possible candidate" } */
if (++z > 10)
_exit(0);
g();
-} /* { dg-warning "possible candidate" } */
+}
void f()
{
@@ -28,15 +28,15 @@ void f()
} /* { dg-bogus "does return" } */
int h()
-{
+{ /* { dg-warning "possible candidate" } */
if (++z > 10)
_exit(0);
return h();
} /* { dg-bogus "end of non-void function" } */
int k()
-{
+{ /* { dg-warning "possible candidate" } */
if (++z > 10)
_exit(0);
k();
-} /* { dg-warning "end of non-void function" } */
+}
diff --git a/gcc/testsuite/gcc.dg/return-type-3.c b/gcc/testsuite/gcc.dg/return-type-3.c
index b6fa16539a4..e06ba7c0233 100644
--- a/gcc/testsuite/gcc.dg/return-type-3.c
+++ b/gcc/testsuite/gcc.dg/return-type-3.c
@@ -3,7 +3,7 @@
call optimization. The return clobber insn was cleaned up and
the warning was never issued. */
/* { dg-do compile } */
-/* { dg-options "-foptimize-sibling-calls -Wreturn-type" } */
+/* { dg-options "-O -foptimize-sibling-calls -Wreturn-type" } */
extern void foo(void);
diff --git a/gcc/testsuite/gcc.dg/uninit-6.c b/gcc/testsuite/gcc.dg/uninit-6.c
index 2c428df79b6..b0f2083ab4b 100644
--- a/gcc/testsuite/gcc.dg/uninit-6.c
+++ b/gcc/testsuite/gcc.dg/uninit-6.c
@@ -34,12 +34,12 @@ struct tree *
make_something(int a, int b, int c)
{
struct tree *rv;
- struct tree *field; /* { dg-bogus "field" "uninitialized variable warning" { xfail *-*-* } } */
+ struct tree *field;
rv = malloc (sizeof (struct tree));
rv->car = 0;
- APPEND(rv, field, INTEGER_T, a);
+ APPEND(rv, field, INTEGER_T, a); /* { dg-bogus "field" "uninitialized variable warning" { xfail *-*-* } } */
APPEND(rv, field, PTR_T, b);
APPEND(rv, field, INTEGER_T, c);
diff --git a/gcc/testsuite/gcc.dg/uninit-8.c b/gcc/testsuite/gcc.dg/uninit-8.c
index 98700f4aa1f..94117da37c9 100644
--- a/gcc/testsuite/gcc.dg/uninit-8.c
+++ b/gcc/testsuite/gcc.dg/uninit-8.c
@@ -11,7 +11,7 @@ void
add_bignums (int *out, int *x, int *y)
{
int p, sum;
- int carry; /* { dg-bogus "carry" "uninitialized variable warning" } */
+ int carry; /* { dg-bogus "carry" "uninitialized variable warning" { xfail *-*-* } } */
p = 0;
for (; *x; x++, y++, out++, p++)