[NFC][Reduce] Add a test showing that we fail to to reduce single/last feature
authorRoman Lebedev <lebedev.ri@gmail.com>
Wed, 22 Jul 2020 13:09:51 +0000 (16:09 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Wed, 22 Jul 2020 13:11:56 +0000 (16:11 +0300)
llvm/test/Reduce/remove-all-of-multiple-args.ll [new file with mode: 0644]
llvm/test/Reduce/remove-single-arg.ll [new file with mode: 0644]

diff --git a/llvm/test/Reduce/remove-all-of-multiple-args.ll b/llvm/test/Reduce/remove-all-of-multiple-args.ll
new file mode 100644 (file)
index 0000000..4ec0ea4
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: llvm-reduce --test FileCheck --test-arg --check-prefixes=CHECK-ALL,CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
+; RUN: cat %t | FileCheck --check-prefixes=CHECK-ALL,CHECK-FINAL %s
+
+define i32 @t(i32 %a0, i32 %a1, i32 %a2) {
+; CHECK-ALL-LABEL: @t
+; CHECK-FINAL: (i32 %a0) {
+;
+; CHECK-INTERESTINGNESS: ret i32
+; CHECK-FINAL: ret i32 undef
+
+  ret i32 %a1
+}
diff --git a/llvm/test/Reduce/remove-single-arg.ll b/llvm/test/Reduce/remove-single-arg.ll
new file mode 100644 (file)
index 0000000..626720f
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: llvm-reduce --test FileCheck --test-arg --check-prefixes=CHECK-ALL,CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
+; RUN: cat %t | FileCheck --check-prefixes=CHECK-ALL,CHECK-FINAL %s
+
+define i32 @t(i32 %a0) {
+; CHECK-ALL-LABEL: @t
+; CHECK-FINAL: (i32 %a0) {
+;
+; CHECK-INTERESTINGNESS: ret i32
+; CHECK-FINAL: ret i32 42
+
+  ret i32 42
+}