[llvm-commits] [poolalloc] r121744 - /poolalloc/trunk/test/dsa/callgraph/scc3.c
Arushi Aggarwal
aggarwa4 at illinois.edu
Mon Dec 13 17:50:09 PST 2010
Author: aggarwa4
Date: Mon Dec 13 19:50:09 2010
New Revision: 121744
URL: http://llvm.org/viewvc/llvm-project?rev=121744&view=rev
Log:
Simplified test case for infinite looping in BU.
Happens in sqlite3.
Added:
poolalloc/trunk/test/dsa/callgraph/scc3.c
Added: poolalloc/trunk/test/dsa/callgraph/scc3.c
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/callgraph/scc3.c?rev=121744&view=auto
==============================================================================
--- poolalloc/trunk/test/dsa/callgraph/scc3.c (added)
+++ poolalloc/trunk/test/dsa/callgraph/scc3.c Mon Dec 13 19:50:09 2010
@@ -0,0 +1,40 @@
+// A, B, func are in an SCC
+// C is called indirectly from A/B
+// The indirect call site in C is resolved, once we process the SCC
+// But since, we never process the SCC graph again,
+// we never inline func into the SCC graph(of A, B, and func) at that
+// call site.
+
+// when we inline the SCCGraph into D(due to call to A), the unresolved
+// call site is also inlined. As it is complete and can be resolved
+// we inline the SCC graph again, pulling in the unresolved call site
+// again. This causes an infinte looping in BU.
+
+;XFAIL:*
+;RUN: not
+
+typedef int* (*funcptr)(int *);
+
+static int* A();
+
+static int* func(int * arg) {
+ A();
+ return arg;
+}
+
+static int* C(funcptr f, int *arg) {
+ (*f)(arg);
+}
+
+static int *B() {
+ func(A());
+ return C(func, A());
+}
+
+static int* A() {
+ return func(B());
+}
+
+static int* D() {
+ return A();
+}
More information about the llvm-commits
mailing list