1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/Reduce/remove-args-used-by-ret.ll
Roman Lebedev 0885e066d4 [Reduce] Argument reduction: don't try to drop terminator instructions
Newly-added test previously crashed.

While it is up for debate whether or not instruction reduction
should be indiscriminate in instruction dropping (there you can
just ensure that the test case is still -verify'ies), here
if we drop terminator, CloneFunctionInto() will immediately crash.

So let's not do that :)
2020-07-21 00:06:03 +03:00

15 lines
453 B
LLVM

; 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
; We can't drop arguments if they are used by terminator instructions.
define i32 @t(i32 %a0, i32 %a1, i32 %a2) {
; CHECK-ALL-LABEL: @t
; CHECK-FINAL-NOT: %a1
;
; CHECK-INTERESTINGNESS: ret i32
; CHECK-FINAL: ret i32 undef
ret i32 %a1
}