blob: 2daf9550f6e037a1a72934700d2760d993fac497 [file] [log] [blame]
Chris Lattneref07cc52004-12-12 05:52:12 +00001; RUN: llvm-as < %s | opt -globalopt -instcombine | llvm-dis | grep 'ret bool true'
2
3;; check that global opt turns integers that only hold 0 or 1 into bools.
4
5%G = internal global int 0 ;; This only holds 0 or 1.
6
7implementation
8
9void %set1() {
10 store int 0, int* %G
11 ret void
12}
13void %set2() {
14 store int 1, int* %G
15 ret void
16}
17
18bool %get() {
19 %A = load int* %G
20 %C = setlt int %A, 2 ;; always true
21 ret bool %C
22}