[PATCH] D120672: [flang][NFC] Add complex operations lowering tests

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 28 12:07:23 PST 2022


clementval created this revision.
clementval added reviewers: jeanPerier, PeteSteinfeld, schweitz, svedanayagam, klausler.
Herald added a project: Flang.
clementval requested review of this revision.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120672

Files:
  flang/test/Lower/complex-operations.f90


Index: flang/test/Lower/complex-operations.f90
===================================================================
--- /dev/null
+++ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120672.411861.patch
Type: text/x-patch
Size: 1137 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220228/069886e9/attachment.bin>


More information about the llvm-commits mailing list