Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
flang/unittests/Optimizer/Builder/Runtime/CommandTest.cpp
Show All 11 Lines | |||||
TEST_F(RuntimeCallTest, genCommandArgumentCountTest) { | TEST_F(RuntimeCallTest, genCommandArgumentCountTest) { | ||||
mlir::Location loc = firBuilder->getUnknownLoc(); | mlir::Location loc = firBuilder->getUnknownLoc(); | ||||
mlir::Value result = fir::runtime::genCommandArgumentCount(*firBuilder, loc); | mlir::Value result = fir::runtime::genCommandArgumentCount(*firBuilder, loc); | ||||
checkCallOp(result.getDefiningOp(), "_FortranAArgumentCount", /*nbArgs=*/0, | checkCallOp(result.getDefiningOp(), "_FortranAArgumentCount", /*nbArgs=*/0, | ||||
/*addLocArgs=*/false); | /*addLocArgs=*/false); | ||||
} | } | ||||
TEST_F(RuntimeCallTest, genArgumentValue) { | TEST_F(RuntimeCallTest, genGetCommandArgument) { | ||||
mlir::Location loc = firBuilder->getUnknownLoc(); | mlir::Location loc = firBuilder->getUnknownLoc(); | ||||
mlir::Type intTy = firBuilder->getDefaultIntegerType(); | mlir::Type intTy = firBuilder->getDefaultIntegerType(); | ||||
mlir::Type charTy = fir::BoxType::get(firBuilder->getNoneType()); | mlir::Type boxTy = fir::BoxType::get(firBuilder->getNoneType()); | ||||
mlir::Value number = firBuilder->create<fir::UndefOp>(loc, intTy); | mlir::Value number = firBuilder->create<fir::UndefOp>(loc, intTy); | ||||
mlir::Value value = firBuilder->create<fir::UndefOp>(loc, charTy); | mlir::Value value = firBuilder->create<fir::UndefOp>(loc, boxTy); | ||||
mlir::Value errmsg = firBuilder->create<fir::UndefOp>(loc, charTy); | mlir::Value length = firBuilder->create<fir::UndefOp>(loc, boxTy); | ||||
mlir::Value result = | mlir::Value errmsg = firBuilder->create<fir::UndefOp>(loc, boxTy); | ||||
fir::runtime::genArgumentValue(*firBuilder, loc, number, value, errmsg); | mlir::Value result = fir::runtime::genGetCommandArgument( | ||||
checkCallOp(result.getDefiningOp(), "_FortranAArgumentValue", /*nbArgs=*/3, | *firBuilder, loc, number, value, length, errmsg); | ||||
/*addLocArgs=*/false); | checkCallOp(result.getDefiningOp(), "_FortranAGetCommandArgument", | ||||
} | /*nbArgs=*/4, | ||||
/*addLocArgs=*/true); | |||||
TEST_F(RuntimeCallTest, genArgumentLen) { | |||||
mlir::Location loc = firBuilder->getUnknownLoc(); | |||||
mlir::Type intTy = firBuilder->getDefaultIntegerType(); | |||||
mlir::Value number = firBuilder->create<fir::UndefOp>(loc, intTy); | |||||
mlir::Value result = | |||||
fir::runtime::genArgumentLength(*firBuilder, loc, number); | |||||
checkCallOp(result.getDefiningOp(), "_FortranAArgumentLength", /*nbArgs=*/1, | |||||
/*addLocArgs=*/false); | |||||
} | } | ||||
TEST_F(RuntimeCallTest, genEnvVariableValue) { | TEST_F(RuntimeCallTest, genEnvVariableValue) { | ||||
mlir::Location loc = firBuilder->getUnknownLoc(); | mlir::Location loc = firBuilder->getUnknownLoc(); | ||||
mlir::Type charTy = fir::BoxType::get(firBuilder->getNoneType()); | mlir::Type charTy = fir::BoxType::get(firBuilder->getNoneType()); | ||||
mlir::Value name = firBuilder->create<fir::UndefOp>(loc, charTy); | mlir::Value name = firBuilder->create<fir::UndefOp>(loc, charTy); | ||||
mlir::Value value = firBuilder->create<fir::UndefOp>(loc, charTy); | mlir::Value value = firBuilder->create<fir::UndefOp>(loc, charTy); | ||||
mlir::Value trimName = firBuilder->create<fir::UndefOp>(loc, i1Ty); | mlir::Value trimName = firBuilder->create<fir::UndefOp>(loc, i1Ty); | ||||
Show All 17 Lines |