aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/CallGraph
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/CallGraph')
-rw-r--r--test/Analysis/CallGraph/2008-09-09-DirectCall.ll13
-rw-r--r--test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll8
-rw-r--r--test/Analysis/CallGraph/dg.exp3
3 files changed, 24 insertions, 0 deletions
diff --git a/test/Analysis/CallGraph/2008-09-09-DirectCall.ll b/test/Analysis/CallGraph/2008-09-09-DirectCall.ll
new file mode 100644
index 0000000000000..456ffa25d7bfd
--- /dev/null
+++ b/test/Analysis/CallGraph/2008-09-09-DirectCall.ll
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | opt -print-callgraph -disable-output |& \
+; RUN: grep {Calls function 'callee'} | count 2
+
+define internal void @callee(...) {
+entry:
+ unreachable
+}
+
+define void @caller() {
+entry:
+ call void (...)* @callee( void (...)* @callee )
+ unreachable
+}
diff --git a/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll b/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll
new file mode 100644
index 0000000000000..ffc27bbe43d1a
--- /dev/null
+++ b/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -print-callgraph -disable-output |& \
+; RUN: grep {Calls function}
+
+@a = global void ()* @f ; <void ()**> [#uses=0]
+
+define internal void @f() {
+ unreachable
+}
diff --git a/test/Analysis/CallGraph/dg.exp b/test/Analysis/CallGraph/dg.exp
new file mode 100644
index 0000000000000..f2005891a59a8
--- /dev/null
+++ b/test/Analysis/CallGraph/dg.exp
@@ -0,0 +1,3 @@
+load_lib llvm.exp
+
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]