xref: /llvm-project/llvm/test/tools/llvm-reduce/reduce-global-variable-terminator-user.ll (revision a50cec5bf9ede33881988e4b9c3bb9b5ee5f7178)
1; 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
2; RUN: FileCheck --check-prefixes=RESULT %s < %t
3
4; The global variable reduction was trying to delete use instructions
5; of globals for some reason, and breaking the basic blocks that had
6; global uses in the terminator
7
8; RESULT-NOT: @zed
9@zed = global i32 0
10
11; INTERESTING: @bar
12; RESULT: @bar
13@bar = global i32 1
14
15; RESULT: define ptr @zed_user() {
16; RESULT-NEXT: ret ptr null
17define ptr @zed_user() {
18  ret ptr @zed
19}
20