Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / Intrinsics / not.f90
blob1c735af41c31dd534d35d99c366059c0fed98cd3
1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
3 subroutine not_test
4 integer :: source
5 integer :: destination
6 ! CHECK-LABEL: not_test
7 ! CHECK: %[[dest:.*]] = fir.alloca i32 {bindc_name = "destination", uniq_name = "_QFnot_testEdestination"}
8 ! CHECK: %[[source:.*]] = fir.alloca i32 {bindc_name = "source", uniq_name = "_QFnot_testEsource"}
9 ! CHECK: %[[loaded_source:.*]] = fir.load %[[source]] : !fir.ref<i32>
10 ! CHECK: %[[all_ones:.*]] = arith.constant -1 : i32
11 ! CHECK: %[[result:.*]] = arith.xori %[[loaded_source]], %[[all_ones]] : i32
12 ! CHECK: fir.store %[[result]] to %[[dest]] : !fir.ref<i32>
13 ! CHECK: return
14 destination = not(source)
15 end subroutine