2006-11-27 01:05:10 +00:00
|
|
|
; Test some floating point casting cases
|
2008-03-09 08:16:40 +00:00
|
|
|
; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | notcast
|
|
|
|
; RUN: llvm-as %s -o - | 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
|
|
|
|
2008-03-09 08:16:40 +00:00
|
|
|
define i8 @test1() {
|
|
|
|
%x = fptoui float 2.550000e+02 to i8 ; <i8> [#uses=1]
|
|
|
|
ret i8 %x
|
2006-11-27 01:05:10 +00:00
|
|
|
}
|
|
|
|
|
2008-03-09 08:16:40 +00:00
|
|
|
define i8 @test2() {
|
|
|
|
%x = fptosi float -1.000000e+00 to i8 ; <i8> [#uses=1]
|
|
|
|
ret i8 %x
|
2006-11-27 01:05:10 +00:00
|
|
|
}
|
2008-03-09 08:16:40 +00:00
|
|
|
|