mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-11 15:26:07 +00:00
New testcase. Shrinking the variable to a bool allows instcombine to delete
the condition. llvm-svn: 18816
This commit is contained in:
parent
02c04bbf45
commit
ff477f8594
22
test/Regression/Transforms/GlobalOpt/integer-bool.ll
Normal file
22
test/Regression/Transforms/GlobalOpt/integer-bool.ll
Normal file
@ -0,0 +1,22 @@
|
||||
; RUN: llvm-as < %s | opt -globalopt -instcombine | llvm-dis | grep 'ret bool 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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user