aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/pr119614-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common/pr119614-3.c')
-rw-r--r--gcc/testsuite/c-c++-common/pr119614-3.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/pr119614-3.c b/gcc/testsuite/c-c++-common/pr119614-3.c
new file mode 100644
index 0000000..59ed36b
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr119614-3.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/119614 */
+/* { dg-do compile { target musttail } } */
+/* { dg-options "-O2" } */
+
+volatile int v;
+
+[[gnu::noinline]] double
+foo (int x)
+{
+ v += x;
+ return 0.5;
+}
+
+double
+bar (int x)
+{
+ if (x == 42)
+ [[gnu::musttail]] return foo (42);
+ [[gnu::musttail]] return foo (32);
+}
+
+double
+baz (int x)
+{
+ if (x == 5)
+ return foo (42);
+ return foo (32);
+}