Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / Intrinsics / ibset.f90
blob7dcaf9f475ea085269e9501ed6f6bade3483b72a
1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
2 ! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
4 ! CHECK-LABEL: ibset_test
5 function ibset_test(i, j)
6 ! CHECK-DAG: %[[result:.*]] = fir.alloca i32 {bindc_name = "ibset_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: %[[VAL_6:.*]] = arith.shli %[[VAL_5]], %[[j]] : i32
11 ! CHECK: %[[VAL_7:.*]] = arith.ori %[[i]], %[[VAL_6]] : i32
12 ! CHECK: fir.store %[[VAL_7]] to %[[result]] : !fir.ref<i32>
13 ! CHECK: %[[VAL_8:.*]] = fir.load %[[result]] : !fir.ref<i32>
14 ! CHECK: return %[[VAL_8]] : i32
15 ibset_test = ibset(i, j)
16 end