[flang-commits] [flang] 0800109 - [fir] Add tests for mlir::ComplexType conversion

Diana Picus via flang-commits flang-commits at lists.llvm.org
Thu Nov 18 04:57:22 PST 2021


Author: Diana Picus
Date: 2021-11-18T12:44:17Z
New Revision: 0800109d26336ac68bfc17d66b6d3087e7d68e1b

URL: https://github.com/llvm/llvm-project/commit/0800109d26336ac68bfc17d66b6d3087e7d68e1b
DIFF: https://github.com/llvm/llvm-project/commit/0800109d26336ac68bfc17d66b6d3087e7d68e1b.diff

LOG: [fir] Add tests for mlir::ComplexType conversion

It turns out that mlir::ComplexType is translated the same way with or
without a conversion in TypeConverter.h. Add tests to make sure this
doesn't change in the future.

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

Differential Revision: https://reviews.llvm.org/D113883

Added: 
    

Modified: 
    flang/test/Fir/types-to-llvm.fir

Removed: 
    


################################################################################
diff  --git a/flang/test/Fir/types-to-llvm.fir b/flang/test/Fir/types-to-llvm.fir
index 6c3223572963..e7b8ea296255 100644
--- a/flang/test/Fir/types-to-llvm.fir
+++ b/flang/test/Fir/types-to-llvm.fir
@@ -196,6 +196,34 @@ func private @foo3(%arg0: !fir.llvm_ptr<!fir.ptr<f32>>)
 
 // -----
 
+// Test MLIR `complex<KIND>` conversion.
+
+func private @foo0(%arg0: complex<f16>)
+// CHECK-LABEL: foo0
+// CHECK-SAME: !llvm.struct<(f16, f16)>)
+
+func private @foo1(%arg0: complex<bf16>)
+// CHECK-LABEL: foo1
+// CHECK-SAME: !llvm.struct<(bf16, bf16)>)
+
+func private @foo2(%arg0: complex<f32>)
+// CHECK-LABEL: foo2
+// CHECK-SAME: !llvm.struct<(f32, f32)>)
+
+func private @foo3(%arg0: complex<f64>)
+// CHECK-LABEL: foo3
+// CHECK-SAME: !llvm.struct<(f64, f64)>)
+
+func private @foo4(%arg0: complex<f80>)
+// CHECK-LABEL: foo4
+// CHECK-SAME: !llvm.struct<(f80, f80)>)
+
+func private @foo5(%arg0: complex<f128>)
+// CHECK-LABEL: foo5
+// CHECK-SAME: !llvm.struct<(f128, f128)>)
+
+// -----
+
 // Test `!fir.complex<KIND>` conversion.
 
 func private @foo0(%arg0: !fir.complex<2>)


        


More information about the flang-commits mailing list