================ @@ -5934,6 +5938,40 @@ IntrinsicLibrary::genSum(mlir::Type resultType, resultType, args); } +// SYSTEM +void IntrinsicLibrary::genSystem(llvm::ArrayRef<fir::ExtendedValue> args) { + assert(args.size() == 2); + mlir::Value command = fir::getBase(args[0]); + const fir::ExtendedValue &exitstat = args[1]; + + if (!command) + fir::emitFatalError(loc, "expected COMMAND parameter"); + + mlir::Type boxNoneTy = fir::BoxType::get(builder.getNoneType()); + + mlir::Value waitBool = builder.createBool(loc, true); + mlir::Value exitstatBox = + isStaticallyPresent(exitstat) + ? fir::getBase(exitstat) + : builder.create<fir::AbsentOp>(loc, boxNoneTy).getResult(); ---------------- tblah wrote:
As I understand it, RUNTIME_CHECK is more like an assertion, so the runtime would crash when given a null existstat: https://github.com/llvm/llvm-project/blob/main/flang/runtime/terminator.h#L103 https://github.com/llvm/llvm-project/pull/74309 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits