[flang-commits] [flang] 89080b8 - [flang][NFC] Add complex operations lowering tests

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Mon Feb 28 12:37:41 PST 2022


Author: Valentin Clement
Date: 2022-02-28T21:37:34+01:00
New Revision: 89080b84146f70b2dc46405042c5777ce2392292

URL: https://github.com/llvm/llvm-project/commit/89080b84146f70b2dc46405042c5777ce2392292
DIFF: https://github.com/llvm/llvm-project/commit/89080b84146f70b2dc46405042c5777ce2392292.diff

LOG: [flang][NFC] Add complex operations lowering tests

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

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

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/flang/test/Lower/complex-operations.f90 b/flang/test/Lower/complex-operations.f90
new file mode 100644
index 0000000000000..b11ce6ee7f215
--- /dev/null
+++ b/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


        


More information about the flang-commits mailing list