summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/builtin-apply4.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-05 20:10:13 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-05 20:10:13 +0000
commit650616602d3b5a15939ce4d74fb101fbabdcebae (patch)
treed987044d0ed96299195ed52d4533e2376afd67de /gcc/testsuite/gcc.dg/builtin-apply4.c
parent99617355e9cba5fc47f5283caefbe0f22ef8c578 (diff)
downloadgcc-650616602d3b5a15939ce4d74fb101fbabdcebae.tar.gz
PR tree-optimization/20076
* tree-inline.c (inline_forbidden_p_1): Prevent inlining functions that call __builtin_return or __builtin_apply_args. * gcc.dg/builtin-apply4.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97653 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtin-apply4.c')
-rw-r--r--gcc/testsuite/gcc.dg/builtin-apply4.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtin-apply4.c b/gcc/testsuite/gcc.dg/builtin-apply4.c
new file mode 100644
index 00000000000..289694e3c1b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-apply4.c
@@ -0,0 +1,30 @@
+/* PR tree-optimization/20076 */
+/* { dg-options "-O2" } */
+/* { dg-do run } */
+
+extern void abort (void);
+
+double
+foo (int arg)
+{
+ if (arg != 116)
+ abort();
+ return arg + 1;
+}
+
+inline double
+bar (int arg)
+{
+ foo (arg);
+ __builtin_return (__builtin_apply ((void (*) ()) foo,
+ __builtin_apply_args (), 16));
+}
+
+int
+main (int argc, char **argv)
+{
+ if (bar (116) != 117.0)
+ abort ();
+
+ return 0;
+}