@@ -126,38 +126,38 @@ TEST_F(HLFIRToolsTest, testScalarCharRoundTrip) {
126126 EXPECT_FALSE (scalarCharEntity.isValue ());
127127}
128128
129- TEST_F (HLFIRToolsTest, testArrayCharRoundTrip) {
130- auto &builder = getBuilder ();
131- mlir::Location loc = getLoc ();
132- llvm::SmallVector<mlir::Value> extents{
133- createConstant (20 ), createConstant (30 )};
134- llvm::SmallVector<mlir::Value> lbounds{
135- createConstant (-1 ), createConstant (-2 )};
136- mlir::Value len = createConstant (42 );
137- mlir::Type charType = fir::CharacterType::getUnknownLen (&context, 1 );
138- mlir::Type seqCharType = builder.getVarLenSeqTy (charType, 2 );
139- mlir::Type arrayCharType = builder.getRefType (seqCharType);
140- mlir::Value arrayCharAddr = builder.create <fir::UndefOp>(loc, arrayCharType);
141- fir::CharArrayBoxValue arrayChar{arrayCharAddr, len, extents, lbounds};
142- hlfir::EntityWithAttributes arrayCharEntity (createDeclare (arrayChar));
143- auto [arrayCharResult, cleanup] =
144- hlfir::translateToExtendedValue (loc, builder, arrayCharEntity);
145- auto *res = arrayCharResult.getBoxOf <fir::CharArrayBoxValue>();
146- EXPECT_FALSE (cleanup.has_value ());
147- ASSERT_NE (res, nullptr );
148- // gtest has a terrible time printing mlir::Value in case of failing
149- // EXPECT_EQ(mlir::Value, mlir::Value). So use EXPECT_TRUE instead.
150- EXPECT_TRUE (fir::getBase (*res) == arrayCharEntity.getFirBase ());
151- EXPECT_TRUE (res->getLen () == arrayChar.getLen ());
152- ASSERT_EQ (res->getExtents ().size (), arrayChar.getExtents ().size ());
153- for (unsigned i = 0 ; i < arrayChar.getExtents ().size (); ++i)
154- EXPECT_TRUE (res->getExtents ()[i] == arrayChar.getExtents ()[i]);
155- ASSERT_EQ (res->getLBounds ().size (), arrayChar.getLBounds ().size ());
156- for (unsigned i = 0 ; i < arrayChar.getLBounds ().size (); ++i)
157- EXPECT_TRUE (res->getLBounds ()[i] == arrayChar.getLBounds ()[i]);
158- EXPECT_TRUE (arrayCharEntity.isVariable ());
159- EXPECT_FALSE (arrayCharEntity.isValue ());
160- }
129+ // TEST_F(HLFIRToolsTest, testArrayCharRoundTrip) {
130+ // auto &builder = getBuilder();
131+ // mlir::Location loc = getLoc();
132+ // llvm::SmallVector<mlir::Value> extents{
133+ // createConstant(20), createConstant(30)};
134+ // llvm::SmallVector<mlir::Value> lbounds{
135+ // createConstant(-1), createConstant(-2)};
136+ // mlir::Value len = createConstant(42);
137+ // mlir::Type charType = fir::CharacterType::getUnknownLen(&context, 1);
138+ // mlir::Type seqCharType = builder.getVarLenSeqTy(charType, 2);
139+ // mlir::Type arrayCharType = builder.getRefType(seqCharType);
140+ // mlir::Value arrayCharAddr = builder.create<fir::UndefOp>(loc, arrayCharType);
141+ // fir::CharArrayBoxValue arrayChar{arrayCharAddr, len, extents, lbounds};
142+ // hlfir::EntityWithAttributes arrayCharEntity(createDeclare(arrayChar));
143+ // auto [arrayCharResult, cleanup] =
144+ // hlfir::translateToExtendedValue(loc, builder, arrayCharEntity);
145+ // auto *res = arrayCharResult.getBoxOf<fir::CharArrayBoxValue>();
146+ // EXPECT_FALSE(cleanup.has_value());
147+ // ASSERT_NE(res, nullptr);
148+ // // gtest has a terrible time printing mlir::Value in case of failing
149+ // // EXPECT_EQ(mlir::Value, mlir::Value). So use EXPECT_TRUE instead.
150+ // EXPECT_TRUE(fir::getBase(*res) == arrayCharEntity.getFirBase());
151+ // EXPECT_TRUE(res->getLen() == arrayChar.getLen());
152+ // ASSERT_EQ(res->getExtents().size(), arrayChar.getExtents().size());
153+ // for (unsigned i = 0; i < arrayChar.getExtents().size(); ++i)
154+ // EXPECT_TRUE(res->getExtents()[i] == arrayChar.getExtents()[i]);
155+ // ASSERT_EQ(res->getLBounds().size(), arrayChar.getLBounds().size());
156+ // for (unsigned i = 0; i < arrayChar.getLBounds().size(); ++i)
157+ // EXPECT_TRUE(res->getLBounds()[i] == arrayChar.getLBounds()[i]);
158+ // EXPECT_TRUE(arrayCharEntity.isVariable());
159+ // EXPECT_FALSE(arrayCharEntity.isValue());
160+ // }
161161
162162TEST_F (HLFIRToolsTest, testArrayCharBoxRoundTrip) {
163163 auto &builder = getBuilder ();
0 commit comments