summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/always_inline3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/always_inline3.c')
-rw-r--r--gcc/testsuite/gcc.dg/always_inline3.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/always_inline3.c b/gcc/testsuite/gcc.dg/always_inline3.c
new file mode 100644
index 000000000..97c80aa52
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/always_inline3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2" } */
+int do_something_evil (void);
+inline __attribute__ ((always_inline)) void
+q2(void) /* { dg-message "sorry\[^\n\]*recursive" "" } */
+{
+ if (do_something_evil ())
+ return;
+ q2(); /* { dg-message "sorry\[^\n\]*called from here" "" } */
+ q2(); /* With -O2 we don't warn here, it is eliminated by tail recursion. */
+}