[llvm] c01a4ad - [llvm-reduce] Add test for BB reduction with non-void ret type.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 30 12:11:30 PDT 2020
Author: Florian Hahn
Date: 2020-08-30T20:11:07+01:00
New Revision: c01a4adf9966aba9bf5acbf6ea07241f6604681e
URL: https://github.com/llvm/llvm-project/commit/c01a4adf9966aba9bf5acbf6ea07241f6604681e
DIFF: https://github.com/llvm/llvm-project/commit/c01a4adf9966aba9bf5acbf6ea07241f6604681e.diff
LOG: [llvm-reduce] Add test for BB reduction with non-void ret type.
Precommit test for D86849.
Added:
llvm/test/Reduce/remove-bbs-ret-nonvoid.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Reduce/remove-bbs-ret-nonvoid.ll b/llvm/test/Reduce/remove-bbs-ret-nonvoid.ll
new file mode 100644
index 000000000000..198da95ad901
--- /dev/null
+++ b/llvm/test/Reduce/remove-bbs-ret-nonvoid.ll
@@ -0,0 +1,32 @@
+; Test that llvm-reduce inserts valid return instructions for functions with
+; on-void return types.
+;
+; RUN: llvm-reduce --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
+; RUN: cat %t | FileCheck %s
+
+; CHECK-INTERESTINGNESS: interesting:
+; CHECK-INTERESTINGNESS: interesting2:
+
+define i32 @main(i1 %c) {
+; CHECK-LABEL: define i32 @main() {
+; CHECK-LABEL: interesting:
+; CHECK-NEXT: br label %interesting2
+
+; CHECK-LABEL: interesting2:
+; CHECK-NEXT: br label %uninteresting1
+
+; CHECK-LABEL: uninteresting1:
+; CHECK-NEXT: ret i32 10
+
+interesting:
+ br label %interesting2
+
+interesting2:
+ br i1 true, label %uninteresting1, label %uninteresting
+
+uninteresting:
+ br label %uninteresting1
+
+uninteresting1:
+ ret i32 10
+}
More information about the llvm-commits
mailing list