mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-13 06:25:02 +00:00
15 lines
352 B
LLVM
15 lines
352 B
LLVM
|
; 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
|
||
|
}
|