! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s ! CHECK-LABEL: iand_test ! CHECK-SAME: %[[A:.*]]: !fir.ref{{.*}}, %[[B:.*]]: !fir.ref{{.*}}, %[[C:.*]]: !fir.ref{{.*}} subroutine iand_test(a, b, c) integer :: a, b, c ! CHECK: %[[A_VAL:.*]] = fir.load %[[A]] : !fir.ref ! CHECK: %[[B_VAL:.*]] = fir.load %[[B]] : !fir.ref c = iand(a, b) ! CHECK: %[[C_VAL:.*]] = arith.andi %[[A_VAL]], %[[B_VAL]] : i32 ! CHECK: fir.store %[[C_VAL]] to %[[C]] : !fir.ref end subroutine iand_test ! CHECK-LABEL: iand_test1 ! CHECK-SAME: %[[A:.*]]: !fir.ref{{.*}}, %[[B:.*]]: !fir.ref{{.*}}, %[[C:.*]]: !fir.ref{{.*}} subroutine iand_test1(a, b, c) integer(kind=1) :: a, b, c ! CHECK: %[[A_VAL:.*]] = fir.load %[[A]] : !fir.ref ! CHECK: %[[B_VAL:.*]] = fir.load %[[B]] : !fir.ref c = iand(a, b) ! CHECK: %[[C_VAL:.*]] = arith.andi %[[A_VAL]], %[[B_VAL]] : i8 ! CHECK: fir.store %[[C_VAL]] to %[[C]] : !fir.ref end subroutine iand_test1 ! CHECK-LABEL: iand_test2 ! CHECK-SAME: %[[A:.*]]: !fir.ref{{.*}}, %[[B:.*]]: !fir.ref{{.*}}, %[[C:.*]]: !fir.ref{{.*}} subroutine iand_test2(a, b, c) integer(kind=2) :: a, b, c ! CHECK: %[[A_VAL:.*]] = fir.load %[[A]] : !fir.ref ! CHECK: %[[B_VAL:.*]] = fir.load %[[B]] : !fir.ref c = iand(a, b) ! CHECK: %[[C_VAL:.*]] = arith.andi %[[A_VAL]], %[[B_VAL]] : i16 ! CHECK: fir.store %[[C_VAL]] to %[[C]] : !fir.ref end subroutine iand_test2 ! CHECK-LABEL: iand_test3 ! CHECK-SAME: %[[A:.*]]: !fir.ref{{.*}}, %[[B:.*]]: !fir.ref{{.*}}, %[[C:.*]]: !fir.ref{{.*}} subroutine iand_test3(a, b, c) integer(kind=4) :: a, b, c ! CHECK: %[[A_VAL:.*]] = fir.load %[[A]] : !fir.ref ! CHECK: %[[B_VAL:.*]] = fir.load %[[B]] : !fir.ref c = iand(a, b) ! CHECK: %[[C_VAL:.*]] = arith.andi %[[A_VAL]], %[[B_VAL]] : i32 ! CHECK: fir.store %[[C_VAL]] to %[[C]] : !fir.ref end subroutine iand_test3 ! CHECK-LABEL: iand_test4 ! CHECK-SAME: %[[A:.*]]: !fir.ref{{.*}}, %[[B:.*]]: !fir.ref{{.*}}, %[[C:.*]]: !fir.ref{{.*}} subroutine iand_test4(a, b, c) integer(kind=8) :: a, b, c ! CHECK: %[[A_VAL:.*]] = fir.load %[[A]] : !fir.ref ! CHECK: %[[B_VAL:.*]] = fir.load %[[B]] : !fir.ref c = iand(a, b) ! CHECK: %[[C_VAL:.*]] = arith.andi %[[A_VAL]], %[[B_VAL]] : i64 ! CHECK: fir.store %[[C_VAL]] to %[[C]] : !fir.ref end subroutine iand_test4 ! CHECK-LABEL: iand_test5 ! CHECK-SAME: %[[A:.*]]: !fir.ref{{.*}}, %[[B:.*]]: !fir.ref{{.*}}, %[[C:.*]]: !fir.ref{{.*}} subroutine iand_test5(a, b, c) integer(kind=16) :: a, b, c ! CHECK: %[[A_VAL:.*]] = fir.load %[[A]] : !fir.ref ! CHECK: %[[B_VAL:.*]] = fir.load %[[B]] : !fir.ref c = iand(a, b) ! CHECK: %[[C_VAL:.*]] = arith.andi %[[A_VAL]], %[[B_VAL]] : i128 ! CHECK: fir.store %[[C_VAL]] to %[[C]] : !fir.ref end subroutine iand_test5 ! CHECK-LABEL: iand_test6 ! CHECK-SAME: %[[S1:.*]]: !fir.ref{{.*}}, %[[S2:.*]]: !fir.ref{{.*}} subroutine iand_test6(s1, s2) integer :: s1, s2 ! CHECK-DAG: %[[S1_VAL:.*]] = fir.load %[[S1]] : !fir.ref ! CHECK-DAG: %[[S2_VAL:.*]] = fir.load %[[S2]] : !fir.ref stop iand(s1,s2) ! CHECK-DAG: %[[ANDI:.*]] = arith.andi %[[S1_VAL]], %[[S2_VAL]] : i32 ! CHECK: fir.call @_FortranAStopStatement(%[[ANDI]], {{.*}}, {{.*}}) {{.*}}: (i32, i1, i1) -> none ! CHECK-NEXT: fir.unreachable end subroutine iand_test6