llvm-6502/test/Transforms/InstCombine/fpcast.ll

15 lines
352 B
LLVM
Raw Normal View History

; Test some floating point casting cases
; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | notcast
; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | \
; RUN: grep 'ret [us]byte \(-1\)\|\(255\)'
sbyte %test() {
%x = fptoui float 255.0 to sbyte
ret sbyte %x
}
ubyte %test() {
%x = fptosi float -1.0 to ubyte
ret ubyte %x
}