diff --git a/src/mapleall/maple_driver/src/mpl_options.cpp b/src/mapleall/maple_driver/src/mpl_options.cpp index f6ce8c02ad9839316ee7fb86a9592ef20916dafb..4d5839bfd5204b5a17fa39f5fe26fb29672325a0 100644 --- a/src/mapleall/maple_driver/src/mpl_options.cpp +++ b/src/mapleall/maple_driver/src/mpl_options.cpp @@ -414,8 +414,11 @@ ErrorCode MplOptions::LtoWriteOptions() { ErrorCode MplOptions::HandleOptions() { if (opts::output.IsEnabledByUser() && inputInfos.size() > 1) { if (opts::rewriteBsc.IsEnabledByUser()) { - LogInfo::MapleLogger(kLlErr) << "Cannot specify -o when generating multiple output files.\n"; - return kErrorInvalidParameter; + // inputInfos : [0] = a.c [1] = a.out + if (!(inputInfos.size() == 2 && (*inputInfos[1]).GetInputName() == "a.out")) { + LogInfo::MapleLogger(kLlErr) << "Cannot specify -o when generating multiple output files.\n"; + return kErrorInvalidParameter; + } } else if (opts::onlyCompile.IsEnabledByUser() || opts::compileWOLink.IsEnabledByUser()) { LogInfo::MapleLogger(kLlErr) << "Cannot specify -o with -c, -S when generating multiple output.\n"; return kErrorInvalidParameter;