[flang-commits] [flang] 4d3ba4e - [flang] Add tests for converting arrays and refs to arrays. NFC

Diana Picus via flang-commits flang-commits at lists.llvm.org
Tue Jan 11 02:05:54 PST 2022


Author: Diana Picus
Date: 2022-01-11T10:05:19Z
New Revision: 4d3ba4e6c8eacd39ba224b6ccb8934856ecb6264

URL: https://github.com/llvm/llvm-project/commit/4d3ba4e6c8eacd39ba224b6ccb8934856ecb6264
DIFF: https://github.com/llvm/llvm-project/commit/4d3ba4e6c8eacd39ba224b6ccb8934856ecb6264.diff

LOG: [flang] Add tests for converting arrays and refs to arrays. NFC

Cover more of the code paths from LLVMTypeConverter::convertPointerLike
and LLVMTypeConverter::convertSequenceType.

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

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 6fbf72a2a4596..599c7924cc73a 100644
--- a/flang/test/Fir/types-to-llvm.fir
+++ b/flang/test/Fir/types-to-llvm.fir
@@ -4,10 +4,11 @@
 
 
 // Test sequence types `!fir.array`
+// Note that we're switching from column-major to row-major here.
 
-func private @foo0(%arg0: !fir.array<10x10xi64>)
+func private @foo0(%arg0: !fir.array<10x12xi64>)
 // CHECK-LABEL: foo0
-// CHECK-SAME: !llvm.array<10 x array<10 x i64>>
+// CHECK-SAME: !llvm.array<12 x array<10 x i64>>
 func private @foo1(%arg0: !fir.array<?xf32>)
 // CHECK-LABEL: foo1
 // CHECK-SAME: !llvm.ptr<f32>
@@ -17,6 +18,21 @@ func private @foo2(%arg0: !fir.array<?x?xf128>)
 func private @foo3(%arg0: !fir.array<*:i32>)
 // CHECK-LABEL: foo3
 // CHECK-SAME: !llvm.ptr<i32>
+func private @foo4(%arg0: !fir.array<3x?xi32>)
+// CHECK-LABEL: foo4
+// CHECK-SAME: !llvm.ptr<array<3 x i32>>
+func private @foo5(%arg0: !fir.array<?x6xi32>)
+// CHECK-LABEL: foo5
+// CHECK-SAME: !llvm.ptr<i32>
+func private @foo6(%arg0: !fir.array<2x?x3x?x4xi32>)
+// CHECK-LABEL: foo6
+// CHECK-SAME: !llvm.ptr<array<2 x i32>
+func private @foo7(%arg0: !fir.array<6x?x!fir.char<1,?>>)
+// CHECK-LABEL: foo7
+// CHECK-SAME: !llvm.ptr<i8>
+func private @foo8(%arg0: !fir.array<6x?x!fir.char<1,3>>)
+// CHECK-LABEL: foo8
+// CHECK-SAME: !llvm.ptr<array<6 x array<3 x i8>
 
 // -----
 
@@ -31,6 +47,21 @@ func private @foo1(%arg0: !fir.ref<!fir.array<10xf32>>)
 func private @foo2(%arg0: !fir.ref<!fir.box<!fir.heap<!fir.type<_QMs1Ta1{x:i32,y:f32}>>>>)
 // CHECK-LABEL: foo2
 // CHECK-SAME: !llvm.ptr<struct<(ptr<struct<"_QMs1Ta1", (i32, f32)>>, i{{.*}}, i{{.*}}, i{{.*}}, i{{.*}}, i{{.*}}, i{{.*}}, ptr<i{{.*}}>, array<1 x i{{.*}}>)>>
+func private @foo3(%arg0: !fir.ref<!fir.array<10x?x11xf32>>)
+// CHECK-LABEL: foo3
+// CHECK-SAME: !llvm.ptr<f32>
+func private @foo4(%arg0: !fir.ref<!fir.array<10x11x?x?xf32>>)
+// CHECK-LABEL: foo4
+// CHECK-SAME: !llvm.ptr<array<11 x array<10 x f32>>>
+func private @foo5(%arg0: !fir.ref<!fir.array<10x!fir.char<1,?>>>)
+// CHECK-LABEL: foo5
+// CHECK-SAME: !llvm.ptr<i8>
+func private @foo6(%arg0: !fir.ref<!fir.array<10x!fir.char<2,8>>>)
+// CHECK-LABEL: foo6
+// CHECK-SAME: !llvm.ptr<array<10 x array<8 x i16>
+func private @foo7(%arg0: !fir.ref<!fir.box<!fir.array<?xf32>>>)
+// CHECK-LABEL: foo7
+// CHECK-SAME: !llvm.ptr<struct<(ptr<f32>, i{{.*}}, i{{.*}}, i{{.*}}, i{{.*}}, i{{.*}}, i{{.*}}, array<1 x array<3 x i{{.*}}>>)>>
 
 // -----
 


        


More information about the flang-commits mailing list