Chris Lattner | ef07cc5 | 2004-12-12 05:52:12 +0000 | [diff] [blame^] | 1 | ; 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 | |||||
7 | implementation | ||||
8 | |||||
9 | void %set1() { | ||||
10 | store int 0, int* %G | ||||
11 | ret void | ||||
12 | } | ||||
13 | void %set2() { | ||||
14 | store int 1, int* %G | ||||
15 | ret void | ||||
16 | } | ||||
17 | |||||
18 | bool %get() { | ||||
19 | %A = load int* %G | ||||
20 | %C = setlt int %A, 2 ;; always true | ||||
21 | ret bool %C | ||||
22 | } |