From 29abf2a4a488629888411f9e1abdc3b47b8f84f0 Mon Sep 17 00:00:00 2001 From: Valentin Clement Date: Mon, 8 Nov 2021 09:41:19 +0100 Subject: [PATCH] [fir] Add test for FIR types conversion 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. Reviewed By: kiranchandramohan, awarzynski Differential Revision: https://reviews.llvm.org/D113283 --- flang/test/Fir/types-to-llvm.fir | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 flang/test/Fir/types-to-llvm.fir diff --git a/flang/test/Fir/types-to-llvm.fir b/flang/test/Fir/types-to-llvm.fir new file mode 100644 index 0000000..5817b2c --- /dev/null +++ b/flang/test/Fir/types-to-llvm.fir @@ -0,0 +1,31 @@ +// 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-LABEL: foo0 +// CHECK-SAME: !llvm.array<10 x array<10 x i64>> +func private @foo1(%arg0: !fir.array) +// CHECK-LABEL: foo1 +// CHECK-SAME: !llvm.ptr +func private @foo2(%arg0: !fir.array) +// CHECK-LABEL: foo2 +// CHECK-SAME: !llvm.ptr +func private @foo3(%arg0: !fir.array<*:i32>) +// CHECK-LABEL: foo3 +// CHECK-SAME: !llvm.ptr + +// ----- + +// Test reference types `!fir.ref` + +func private @foo0(%arg0: !fir.ref) +// CHECK-LABEL: foo0 +// CHECK-SAME: !llvm.ptr +func private @foo1(%arg0: !fir.ref>) +// CHECK-LABEL: foo1 +// CHECK-SAME: !llvm.ptr> + -- 2.7.4