2006-11-27 02:05:10 +01:00
|
|
|
; Test some floating point casting cases
|
2006-12-02 05:23:10 +01: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 22:02:51 +02:00
|
|
|
; RUN: egrep {ret i8 \(-1\)\|\(255\)}
|
2006-11-27 02:05:10 +01:00
|
|
|
|
2006-12-31 07:02:00 +01:00
|
|
|
sbyte %test1() {
|
2006-11-27 02:05:10 +01:00
|
|
|
%x = fptoui float 255.0 to sbyte
|
|
|
|
ret sbyte %x
|
|
|
|
}
|
|
|
|
|
2006-12-31 07:02:00 +01:00
|
|
|
ubyte %test2() {
|
2006-11-27 02:05:10 +01:00
|
|
|
%x = fptosi float -1.0 to ubyte
|
|
|
|
ret ubyte %x
|
|
|
|
}
|