aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/Inline/inline_dce.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/Inline/inline_dce.ll')
-rw-r--r--test/Transforms/Inline/inline_dce.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Transforms/Inline/inline_dce.ll b/test/Transforms/Inline/inline_dce.ll
new file mode 100644
index 0000000..5cb118f
--- /dev/null
+++ b/test/Transforms/Inline/inline_dce.ll
@@ -0,0 +1,26 @@
+; This checks to ensure that the inline pass deletes functions if they get
+; inlined into all of their callers.
+
+; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
+; RUN: not grep %reallysmall
+
+implementation
+
+internal int %reallysmall(int %A) {
+ ret int %A
+}
+
+void %caller1() {
+ call int %reallysmall(int 5)
+ ret void
+}
+
+void %caller2(int %A) {
+ call int %reallysmall(int %A)
+ ret void
+}
+
+int %caller3(int %A) {
+ %B = call int %reallysmall(int %A)
+ ret int %B
+}