The following fixes the known failures of the must-tail-call tests.

Tested with --target=
* aarch64-unknown-linux-gnu
* ia64-unknown-linux-gnu
* m68k-unknown-linux-gnu
* x86_64-pc-linux-gnu
 
OK for trunk?

gcc/testsuite/ChangeLog:
        * gcc.dg/plugin/must-tail-call-2.c (test_2_caller): Generalize
        expected error message to allow "argument must by passed by
        copying".
        (test_3): Generalize expected error message to allow for failure
        of targetm.function_ok_for_sibcall.
        (test_4): Likewise.
        (test_5): Likewise.
---
 gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c 
b/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c
index c5504f8..ca81b35 100644
--- a/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c
+++ b/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c
@@ -29,14 +29,14 @@ int __attribute__((noinline,noclone))
 test_2_caller (int i)
 {
   struct box b;
-  return test_2_callee (i + 1, b); /* { dg-error "cannot tail-call: callee 
required more stack slots than the caller" } */
+  return test_2_callee (i + 1, b); /* { dg-error "cannot tail-call: callee 
required more stack slots than the caller|argument must be passed by copying" } 
*/
 }
 
 extern void setjmp (void);
 void
 test_3 (void)
 {
-  setjmp (); /* { dg-error "cannot tail-call: callee returns twice" } */
+  setjmp (); /* { dg-error "cannot tail-call: callee returns twice|target is 
not able to optimize the call into a sibling call" } */
 }
 
 void
@@ -45,7 +45,7 @@ test_4 (void)
   void nested (void)
   {
   }
-  nested (); /* { dg-error "cannot tail-call: nested function" } */
+  nested (); /* { dg-error "cannot tail-call: nested function|target is not 
able to optimize the call into a sibling call" } */
 }
 
 typedef void (fn_ptr_t) (void);
@@ -54,5 +54,5 @@ volatile fn_ptr_t fn_ptr;
 void
 test_5 (void)
 {
-  fn_ptr (); /* { dg-error "cannot tail-call: callee does not return" } */
+  fn_ptr (); /* { dg-error "cannot tail-call: callee does not return|target is 
not able to optimize the call into a sibling call" } */
 }
-- 
1.8.5.3

Reply via email to