mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 00:16:04 +00:00

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.
20 lines
607 B
LLVM
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
|
|
}
|