aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/fpcast.ll
blob: 5d0f55bc6443fa147c590d8b791fb3cd8578bbd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; Test some floating point casting cases
; RUN: llvm-as %s -o - | opt -instcombine -S | notcast
; RUN: llvm-as %s -o - | opt -instcombine -S | \
; RUN:   egrep {ret i8 \(-1\)\|\(255\)}

define i8 @test1() {
        %x = fptoui float 2.550000e+02 to i8            ; <i8> [#uses=1]
        ret i8 %x
}

define i8 @test2() {
        %x = fptosi float -1.000000e+00 to i8           ; <i8> [#uses=1]
        ret i8 %x
}