1 ! RUN: bbc %s -o - | FileCheck %s
3 ! CHECK-LABEL: sign_testi
4 subroutine sign_testi(a
, b
, c
)
6 ! CHECK: %[[VAL_1:.*]] = arith.shrsi %{{.*}}, %{{.*}} : i32
7 ! CHECK: %[[VAL_2:.*]] = arith.xori %{{.*}}, %[[VAL_1]] : i32
8 ! CHECK: %[[VAL_3:.*]] = arith.subi %[[VAL_2]], %[[VAL_1]] : i32
9 ! CHECK-DAG: %[[VAL_4:.*]] = arith.subi %{{.*}}, %[[VAL_3]] : i32
10 ! CHECK-DAG: %[[VAL_5:.*]] = arith.cmpi slt, %{{.*}}, %{{.*}} : i32
11 ! CHECK: select %[[VAL_5]], %[[VAL_4]], %[[VAL_3]] : i32
15 ! CHECK-LABEL: sign_testr
16 subroutine sign_testr(a
, b
, c
)
18 ! CHECK-NOT: fir.call @{{.*}}fabs
19 ! CHECK: math.copysign{{.*}} : f32
23 ! CHECK-LABEL: sign_testr2
24 subroutine sign_testr2(a
, b
, c
)
26 ! CHECK-NOT: fir.call @{{.*}}fabs
27 ! CHECK: math.copysign{{.*}} : f128