1; RUN: opt < %s -globalopt -instcombine | \
2; RUN:    llvm-dis | grep {ret i1 true}
3
4;; check that global opt turns integers that only hold 0 or 1 into bools.
5
6@G = internal global i32 0              ; <i32*> [#uses=3]
7
8define void @set1() {
9        store i32 0, i32* @G
10        ret void
11}
12
13define void @set2() {
14        store i32 1, i32* @G
15        ret void
16}
17
18define i1 @get() {
19        %A = load i32* @G               ; <i32> [#uses=1]
20        %C = icmp slt i32 %A, 2         ; <i1> [#uses=1]
21        ret i1 %C
22}
23
24