aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/s390/pr119873-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/s390/pr119873-4.c')
-rw-r--r--gcc/testsuite/gcc.target/s390/pr119873-4.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/s390/pr119873-4.c b/gcc/testsuite/gcc.target/s390/pr119873-4.c
new file mode 100644
index 0000000..384170c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/pr119873-4.c
@@ -0,0 +1,27 @@
+/* PR target/119873 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern int foo (int, int, int, long long, int);
+
+int
+bar (int u, int v, int w, long long x, int y)
+{
+ [[gnu::musttail]] return foo (u, v, w, x + 1, y - 1); /* { dg-error "cannot tail-call: target is not able to optimize the call into a sibling call" } */
+}
+
+extern int baz (int, int, int, int, int);
+
+int
+qux (int u, int v, int w, int x, int y)
+{
+ [[gnu::musttail]] return baz (u, v, w, x, y + 1); /* { dg-error "cannot tail-call: target is not able to optimize the call into a sibling call" } */
+}
+
+extern int corge (int, int, int, int, unsigned short);
+
+int
+garply (int u, int v, int w, int x, unsigned short y)
+{
+ [[gnu::musttail]] return corge (u, v, w, x, y + 1); /* { dg-error "cannot tail-call: target is not able to optimize the call into a sibling call" } */
+}