Previously, if the basic-blocks delta pass tried to remove a basic block that was the last basic block in a function that did not have external or weak linkage, the resulting IR would become invalid. Since removing the last basic block in a function is effectively identical to removing the function body itself, we check explicitly for this case and if we detect it, we run the same logic as in ReduceFunctionBodies.cpp Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D113486
22 lines
596 B
LLVM
22 lines
596 B
LLVM
; RUN: llvm-reduce --delta-passes=basic-blocks --abort-on-invalid-reduction --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
|
|
|
|
; CHECK-FINAL-NOT: = comdat
|
|
; CHECK-INTERESTINGNESS: @callee(
|
|
; CHECK-FINAL: declare void @callee()
|
|
|
|
$foo = comdat any
|
|
|
|
define void @callee() comdat($foo) {
|
|
ret void
|
|
}
|
|
|
|
; CHECK-ALL: define void @caller()
|
|
define void @caller() {
|
|
entry:
|
|
; CHECK-ALL: call void @callee()
|
|
; CHECK-ALL: ret void
|
|
call void @callee()
|
|
ret void
|
|
}
|