Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / Intrinsics / ibclr.f90
blobec30b251a867be88e159f92dd8c71b8db66e9d67
1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
2 ! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
4 ! CHECK-LABEL: ibclr_test
5 function ibclr_test(i, j)
6 ! CHECK-DAG: %[[result:.*]] = fir.alloca i32 {bindc_name = "ibclr_test"
7 ! CHECK-DAG: %[[i:.*]] = fir.load %arg0 : !fir.ref<i32>
8 ! CHECK-DAG: %[[j:.*]] = fir.load %arg1 : !fir.ref<i32>
9 ! CHECK-DAG: %[[VAL_5:.*]] = arith.constant 1 : i32
10 ! CHECK-DAG: %[[VAL_6:.*]] = arith.constant -1 : i32
11 ! CHECK: %[[VAL_7:.*]] = arith.shli %[[VAL_5]], %[[j]] : i32
12 ! CHECK: %[[VAL_8:.*]] = arith.xori %[[VAL_6]], %[[VAL_7]] : i32
13 ! CHECK: %[[VAL_9:.*]] = arith.andi %[[i]], %[[VAL_8]] : i32
14 ! CHECK: fir.store %[[VAL_9]] to %[[result]] : !fir.ref<i32>
15 ! CHECK: %[[VAL_10:.*]] = fir.load %[[result]] : !fir.ref<i32>
16 ! CHECK: return %[[VAL_10]] : i32
17 ibclr_test = ibclr(i, j)
18 end