aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Transforms/Inline/cfg_preserve_test.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/Inline/cfg_preserve_test.ll b/test/Transforms/Inline/cfg_preserve_test.ll
new file mode 100644
index 0000000000..83179a045c
--- /dev/null
+++ b/test/Transforms/Inline/cfg_preserve_test.ll
@@ -0,0 +1,15 @@
+; This test ensures that inlining an "empty" function does not destroy the CFG
+;
+; RUN: as < %s | opt -inline | dis | not grep br
+
+int %func(int %i) {
+ ret int %i
+}
+
+declare void %bar()
+
+int %main(int %argc) {
+Entry:
+ %X = call int %func(int 7)
+ ret int %X
+}