llvm-project/llvm/test/tools/llvm-reduce/reduce-global-variable-terminator-user.ll
Matt Arsenault a50cec5bf9 llvm-reduce: Don't delete instructions in global variable reduction
For some reason the global variable reduction was trying to delete
use instructions. This broke the verifier if the user was a terminator,
since the block now no longer has one. It doesn't make sense for this
reduction to delete the users, so just stop doing that.
2023-01-05 10:26:02 -05:00

20 lines
607 B
LLVM

; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=global-variables --test FileCheck --test-arg --check-prefixes=INTERESTING --test-arg %s --test-arg --input-file %s -o %t
; RUN: FileCheck --check-prefixes=RESULT %s < %t
; The global variable reduction was trying to delete use instructions
; of globals for some reason, and breaking the basic blocks that had
; global uses in the terminator
; RESULT-NOT: @zed
@zed = global i32 0
; INTERESTING: @bar
; RESULT: @bar
@bar = global i32 1
; RESULT: define ptr @zed_user() {
; RESULT-NEXT: ret ptr null
define ptr @zed_user() {
ret ptr @zed
}