Reid Spencer | 3da59db | 2006-11-27 01:05:10 +0000 | [diff] [blame^] | 1 | ; Test some floating point casting cases |
2 | ; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | notcast | ||||
3 | ; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | \ | ||||
4 | ; RUN: grep 'ret [us]byte \(-1\)\|\(255\)' | ||||
5 | |||||
6 | sbyte %test() { | ||||
7 | %x = fptoui float 255.0 to sbyte | ||||
8 | ret sbyte %x | ||||
9 | } | ||||
10 | |||||
11 | ubyte %test() { | ||||
12 | %x = fptosi float -1.0 to ubyte | ||||
13 | ret ubyte %x | ||||
14 | } |