brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · d25bdd8 Raw
25 lines · plain
1! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s2 3! CHECK-LABEL: ishft_test4function ishft_test(i, j)5    ! CHECK-DAG: %[[result:.*]] = fir.alloca i32 {bindc_name = "ishft_test"6    ! CHECK-DAG:  %[[i:.*]] = fir.load %arg0 : !fir.ref<i32>7    ! CHECK-DAG:  %[[j:.*]] = fir.load %arg1 : !fir.ref<i32>8    ! CHECK-DAG:  %[[VAL_5:.*]] = arith.constant 32 : i329    ! CHECK-DAG:  %[[VAL_6:.*]] = arith.constant 0 : i3210    ! CHECK-DAG:  %[[VAL_7:.*]] = arith.constant 31 : i3211    ! CHECK:  %[[VAL_8:.*]] = arith.shrsi %[[j]], %[[VAL_7]] : i3212    ! CHECK:  %[[VAL_9:.*]] = arith.xori %[[j]], %[[VAL_8]] : i3213    ! CHECK:  %[[VAL_10:.*]] = arith.subi %[[VAL_9]], %[[VAL_8]] : i3214    ! CHECK:  %[[VAL_11:.*]] = arith.shli %[[i]], %[[VAL_10]] : i3215    ! CHECK:  %[[VAL_12:.*]] = arith.shrui %[[i]], %[[VAL_10]] : i3216    ! CHECK:  %[[VAL_13:.*]] = arith.cmpi sge, %[[VAL_10]], %[[VAL_5]] : i3217    ! CHECK:  %[[VAL_14:.*]] = arith.cmpi slt, %[[j]], %[[VAL_6]] : i3218    ! CHECK:  %[[VAL_15:.*]] = arith.select %[[VAL_14]], %[[VAL_12]], %[[VAL_11]] : i3219    ! CHECK:  %[[VAL_16:.*]] = arith.select %[[VAL_13]], %[[VAL_6]], %[[VAL_15]] : i3220    ! CHECK:  fir.store %[[VAL_16]] to %[[result]] : !fir.ref<i32>21    ! CHECK:  %[[VAL_17:.*]] = fir.load %[[result]] : !fir.ref<i32>22    ! CHECK:  return %[[VAL_17]] : i3223    ishft_test = ishft(i, j)24  end25