[llvm-commits] [poolalloc] r119688 - /poolalloc/trunk/test/dsa/callgraph/scc.ll

Arushi Aggarwal aggarwa4 at illinois.edu
Wed Nov 17 23:13:14 PST 2010


Author: aggarwa4
Date: Thu Nov 18 01:13:14 2010
New Revision: 119688

URL: http://llvm.org/viewvc/llvm-project?rev=119688&view=rev
Log:
To test that the correct call graph is reported for SCCs.
The call graph for each call site gives the leader of the 
SCC that might be callable, and we must then iterate through
the SCC to get the actual callees. Also, we must iterate
through the SCC for the caller function.

Added:
    poolalloc/trunk/test/dsa/callgraph/scc.ll

Added: poolalloc/trunk/test/dsa/callgraph/scc.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/callgraph/scc.ll?rev=119688&view=auto
==============================================================================
--- poolalloc/trunk/test/dsa/callgraph/scc.ll (added)
+++ poolalloc/trunk/test/dsa/callgraph/scc.ll Thu Nov 18 01:13:14 2010
@@ -0,0 +1,41 @@
+;RUN: dsaopt %s -dsa-cbu -analyze -check-callees=B,A
+;RUN: dsaopt %s -dsa-bu -analyze -check-callees=A,B
+; ModuleID = 'scc.o'
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @A() nounwind {
+entry:
+  call void (...)* bitcast (void ()* @B to void (...)*)() nounwind
+  br label %return
+
+return:                                           ; preds = %entry
+  ret void
+}
+
+define void @B() nounwind {
+entry:
+  call void @A() nounwind
+  br label %return
+
+return:                                           ; preds = %entry
+  ret void
+}
+
+define void @D() nounwind {
+entry:
+  call void (...)* bitcast (void ()* @C to void (...)*)() nounwind
+  br label %return
+
+return:                                           ; preds = %entry
+  ret void
+}
+
+define void @C() nounwind {
+entry:
+  call void @D() nounwind
+  br label %return
+
+return:                                           ; preds = %entry
+  ret void
+}





More information about the llvm-commits mailing list