Skip to content

Commit

Permalink
[flang][NFC] Add complex operations lowering tests
Browse files Browse the repository at this point in the history
Just adds some lowering test for complex operations. These were not
added when the lowering landed.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: schweitz

Differential Revision: https://reviews.llvm.org/D120672
  • Loading branch information
clementval committed Feb 28, 2022
1 parent 223b824 commit 89080b8
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions flang/test/Lower/complex-operations.f90
@@ -0,0 +1,37 @@
! RUN: bbc %s -o - | FileCheck %s

! CHECK-LABEL: @_QPadd_test
subroutine add_test(a,b,c)
complex :: a, b, c
! CHECK-NOT: fir.extract_value
! CHECK-NOT: fir.insert_value
! CHECK: fir.addc {{.*}}: !fir.complex
a = b + c
end subroutine add_test

! CHECK-LABEL: @_QPsub_test
subroutine sub_test(a,b,c)
complex :: a, b, c
! CHECK-NOT: fir.extract_value
! CHECK-NOT: fir.insert_value
! CHECK: fir.subc {{.*}}: !fir.complex
a = b - c
end subroutine sub_test

! CHECK-LABEL: @_QPmul_test
subroutine mul_test(a,b,c)
complex :: a, b, c
! CHECK-NOT: fir.extract_value
! CHECK-NOT: fir.insert_value
! CHECK: fir.mulc {{.*}}: !fir.complex
a = b * c
end subroutine mul_test

! CHECK-LABEL: @_QPdiv_test
subroutine div_test(a,b,c)
complex :: a, b, c
! CHECK-NOT: fir.extract_value
! CHECK-NOT: fir.insert_value
! CHECK: fir.divc {{.*}}: !fir.complex
a = b / c
end subroutine div_test

0 comments on commit 89080b8

Please sign in to comment.