2006-11-27 01:05:10 +00:00
|
|
|
; Test some floating point casting cases
|
2006-12-02 04:23:10 +00:00
|
|
|
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | notcast
|
|
|
|
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \
|
2007-04-14 20:02:51 +00:00
|
|
|
; RUN: egrep {ret i8 \(-1\)\|\(255\)}
|
2006-11-27 01:05:10 +00:00
|
|
|
|
2006-12-31 06:02:00 +00:00
|
|
|
sbyte %test1() {
|
2006-11-27 01:05:10 +00:00
|
|
|
%x = fptoui float 255.0 to sbyte
|
|
|
|
ret sbyte %x
|
|
|
|
}
|
|
|
|
|
2006-12-31 06:02:00 +00:00
|
|
|
ubyte %test2() {
|
2006-11-27 01:05:10 +00:00
|
|
|
%x = fptosi float -1.0 to ubyte
|
|
|
|
ret ubyte %x
|
|
|
|
}
|