xref: /llvm-project/llvm/test/Transforms/Float2Int/float2int-optnone.ll (revision 3d152bc49ddc87350eb1c588b083b24858bf6d51)
1*3d152bc4SBjorn Pettersson; RUN: opt < %s -passes=float2int -S | FileCheck %s
2cee313d2SEric Christopher;
3cee313d2SEric Christopher; Verify that pass float2int is not run on optnone functions.
4cee313d2SEric Christopher
5cee313d2SEric Christopherdefine i16 @simple1(i8 %a) #0 {
6cee313d2SEric Christopher; CHECK-LABEL: @simple1
7cee313d2SEric Christopher; CHECK:  %1 = uitofp i8 %a to float
8cee313d2SEric Christopher; CHECK-NEXT:  %2 = fadd float %1, 1.0
9cee313d2SEric Christopher; CHECK-NEXT:  %3 = fptoui float %2 to i16
10cee313d2SEric Christopher; CHECK-NEXT:  ret i16 %3
11cee313d2SEric Christopher  %1 = uitofp i8 %a to float
12cee313d2SEric Christopher  %2 = fadd float %1, 1.0
13cee313d2SEric Christopher  %3 = fptoui float %2 to i16
14cee313d2SEric Christopher  ret i16 %3
15cee313d2SEric Christopher}
16cee313d2SEric Christopher
17cee313d2SEric Christopherattributes #0 = { noinline optnone }
18