1 ; Test that llvm-reduce can remove uninteresting Global Variables as well as
2 ; their direct uses (which in turn are replaced with 'undef').
4 ; RUN: llvm-reduce --test %p/Inputs/remove-global-vars.py %s -o - | FileCheck %s
7 ; CHECK: @interesting = global
8 @interesting = global i32 0, align 4
10 @uninteresting = global i32 1, align 4
14 ; CHECK-NOT: load i32, i32* @uninteresting, align 4
15 %0 = load i32, i32* @uninteresting, align 4
16 ; CHECK: store i32 undef, i32* @interesting, align 4
17 store i32 %0, i32* @interesting, align 4
19 ; CHECK: load i32, i32* @interesting, align 4
20 %1 = load i32, i32* @interesting, align 4
21 ; CHECK-NOT: store i32 %1, i32* @uninteresting, align 4
22 store i32 %1, i32* @uninteresting, align 4
24 ; CHECK: %inc = add nsw i32 undef, 1
25 %inc = add nsw i32 %0, 1
26 ; CHECK: store i32 %inc, i32* @interesting, align 4
27 store i32 %inc, i32* @interesting, align 4