summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/20080530.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/20080530.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20080530.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20080530.c b/gcc/testsuite/gcc.dg/tree-ssa/20080530.c
new file mode 100644
index 00000000000..6da7cb8a03a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20080530.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-einline" } */
+
+void bar (char *);
+int i;
+
+static void
+foo (void)
+{
+ char *p = __builtin_alloca (i);
+ bar (p);
+}
+
+int
+baz (void)
+{
+ foo (); /* foo() should not be inlined here because it calls alloca */
+ return 6;
+}
+
+/* { dg-final { scan-tree-dump-times "Inlining foo into baz" 0 "einline2"} } */
+/* { dg-final { cleanup-tree-dump "einline2" } } */