diff --git a/flang/lib/Optimizer/CodeGen/TypeConverter.h b/flang/lib/Optimizer/CodeGen/TypeConverter.h --- a/flang/lib/Optimizer/CodeGen/TypeConverter.h +++ b/flang/lib/Optimizer/CodeGen/TypeConverter.h @@ -41,6 +41,8 @@ return mlir::IntegerType::get( &getContext(), kindMapping.getLogicalBitsize(boolTy.getFKind())); }); + addConversion( + [&](fir::PointerType pointer) { return convertPointerLike(pointer); }); addConversion( [&](fir::RecordType derived) { return convertRecordType(derived); }); addConversion( diff --git a/flang/test/Fir/types-to-llvm.fir b/flang/test/Fir/types-to-llvm.fir --- a/flang/test/Fir/types-to-llvm.fir +++ b/flang/test/Fir/types-to-llvm.fir @@ -31,6 +31,18 @@ // ----- +// Test pointer types `!fir.ptr` + +func private @foo0(%arg0: !fir.ptr) +// CHECK-LABEL: foo0 +// CHECK-SAME: !llvm.ptr + +func private @foo1(%arg0: !fir.ptr>) +// CHECK-LABEL: foo1 +// CHECK-SAME: !llvm.ptr> + +// ----- + // Test box types `!fir.box` func private @foo0(%arg0: !fir.box>)