[SimplifyLibCalls] Add a test to make sure we lower fls(0) correctly.

llvm-svn: 289895
This commit is contained in:
Davide Italiano 2016-12-15 23:48:07 +00:00
parent 85ad36b0e0
commit 67e979e086
1 changed files with 9 additions and 0 deletions

View File

@ -43,6 +43,15 @@ define i32 @flsnotconst(i64 %z) {
ret i32 %goo
}
; Make sure we lower fls(0) to 0 and not to `undef`.
; CHECK-LABEL: define i32 @flszero(
; CHECK: ret i32 0
; CHECK: }
define i32 @flszero() {
%zero = call i32 @fls(i32 0)
ret i32 %zero
}
declare i32 @fls(i32)
declare i32 @flsl(i64)
declare i32 @flsll(i64)