llvm-6502/test/Transforms/GlobalOpt/integer-bool.ll
Reid Spencer 737ec5130e For PR1043:
Bye, Bye Booly. Remove the use of the bool type from non-upgraded test
cases and from grep expressions. The parser doesn't accept it and the
asm writer doesn't produce it any more.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33183 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 05:06:52 +00:00

24 lines
444 B
LLVM

; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -instcombine | \
; RUN: llvm-dis | grep 'ret i1 true'
;; check that global opt turns integers that only hold 0 or 1 into bools.
%G = internal global int 0 ;; This only holds 0 or 1.
implementation
void %set1() {
store int 0, int* %G
ret void
}
void %set2() {
store int 1, int* %G
ret void
}
bool %get() {
%A = load int* %G
%C = setlt int %A, 2 ;; always true
ret bool %C
}