File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
lib/Optimizer/HLFIR/Transforms Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -448,10 +448,9 @@ struct AssociateOpConversion
448448 sourceVar = builder.create <fir::BoxAddrOp>(loc, assocType, sourceVar);
449449 } else if (mlir::isa<fir::ReferenceType>(sourceVar.getType ()) &&
450450 mlir::isa<fir::BoxCharType>(assocType)) {
451+ mlir::Value lenVal = associate.getTypeparams ()[0 ];
451452 auto refTy = mlir::cast<fir::ReferenceType>(sourceVar.getType ());
452453 auto charTy = mlir::dyn_cast<fir::CharacterType>(refTy.getEleTy ());
453- mlir::Value lenVal = builder.createIntegerConstant (
454- loc, builder.getCharacterLengthType (), charTy.getLen ());
455454 auto boxCharType =
456455 fir::BoxCharType::get (builder.getContext (), charTy.getFKind ());
457456 sourceVar = builder.create <fir::EmboxCharOp>(loc, boxCharType,
Original file line number Diff line number Diff line change 1- ! RUN: bbc -emit-fir -o - %s | FileCheck %s
1+ ! RUN: %flang_fc1 -emit-fir -o - %s | FileCheck %s
22
33! Checking no reference to boxchar conversion is in the emitted fir.
44! CHECK-NOT: (!fir.ref<!fir.char<1,4>>) -> !fir.boxchar<1>
5+ ! CHECK: %[[Const4:.*]] = arith.constant 4 : index
6+ ! CHECK: fir.emboxchar
57
68program main
79 logical ,dimension (1 ):: mask = .true.
You can’t perform that action at this time.
0 commit comments