re PR middle-end/42995 (inline-small-functions does not inline simple delegation...
authorRichard Guenther <rguenther@suse.de>
Mon, 8 Feb 2010 10:41:25 +0000 (10:41 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 8 Feb 2010 10:41:25 +0000 (10:41 +0000)
2010-02-08  Richard Guenther  <rguenther@suse.de>

PR middle-end/42995
* gcc.dg/tree-ssa/inline-4.c: New testcase.

From-SVN: r156598

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/inline-4.c [new file with mode: 0644]

index e1db911727416fa93f234a3b84c7d218bf443ad9..ced96b7f01b20efd211eed04b321bcea2c2701a1 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-08  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/42995
+       * gcc.dg/tree-ssa/inline-4.c: New testcase.
+
 2010-02-07  Sebastian Pop  <sebastian.pop@amd.com>
 
        * gcc.dg/graphite/block-0.c: Call abort for runtime test.  Always
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-4.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-4.c
new file mode 100644 (file)
index 0000000..50bec02
--- /dev/null
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-einline2" } */
+
+extern int rand(void);
+
+int get_data_for (int id)
+{
+  return rand();
+}
+
+int my_id;
+
+int main()
+{
+  int res = get_data_for (my_id);
+  switch (res)
+    {
+      case 0:
+         return 666;
+      default:
+         return -1;
+    }
+}
+
+/* { dg-final { scan-tree-dump "Inlining get_data_for into main" "einline2" } } */
+/* { dg-final { cleanup-tree-dump "einline2" } } */