[PATCH] D113283: [fir] Add test for FIR types conversion

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 5 07:58:23 PDT 2021


clementval created this revision.
clementval added reviewers: jeanPerier, svedanayagam, sscalpone, kiranchandramohan, jdoerfert, schweitz, pmccormick, rovka, AlexisPerry, PeteSteinfeld.
Herald added a project: Flang.
clementval requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Add a separate file to test FIR types conversion to LLVM types.
Conversion comes from `flang/lib/Optimizer/CodeGen/TypeConverter.h`

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113283

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


Index: flang/test/Fir/types-to-llvm.fir
===================================================================
--- /dev/null
+++ flang/test/Fir/types-to-llvm.fir
@@ -0,0 +1,25 @@
+// Test FIR types conversion.
+
+// RUN: fir-opt --split-input-file --fir-to-llvm-ir %s | FileCheck %s
+
+
+// Test sequence types `!fir.array`
+
+func private @foo0(%arg0: !fir.array<10x10xi64>)
+// CHECK: !llvm.array<10 x array<10 x i64>>
+func private @foo1(%arg0: !fir.array<?xf32>)
+// CHECK: !llvm.ptr<f32>
+func private @foo2(%arg0: !fir.array<?x?xf128>)
+// CHECK: !llvm.ptr<f128>
+func private @foo3(%arg0: !fir.array<*:i32>)
+// CHECK: !llvm.ptr<i32>
+
+// -----
+
+// Test reference types `!fir.ref`
+
+func private @foo0(%arg0: !fir.ref<i32>)
+// CHECK: !llvm.ptr<i32>
+func private @foo1(%arg0: !fir.ref<!fir.array<10xf32>>)
+// CHECK: !llvm.ptr<array<10 x f32>>
+


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113283.385075.patch
Type: text/x-patch
Size: 855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211105/7e8d72fc/attachment.bin>


More information about the llvm-commits mailing list