diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -4883,6 +4883,11 @@ return "-"; } + if (JA.getType() == types::TY_ModuleFile && + C.getArgs().getLastArg(options::OPT_module_file_info)) { + return "-"; + } + // Is this the assembly listing for /FA? if (JA.getType() == types::TY_PP_Asm && (C.getArgs().hasArg(options::OPT__SLASH_FA) || diff --git a/clang/test/Modules/module_file_info.m b/clang/test/Modules/module_file_info.m --- a/clang/test/Modules/module_file_info.m +++ b/clang/test/Modules/module_file_info.m @@ -7,8 +7,8 @@ // RUN: %clang_cc1 -module-file-info %t/DependsOnModule.pcm | FileCheck %s --check-prefix=RAW // RUN: %clang_cc1 -w -Wunused -fmodules -fmodule-format=obj -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t-obj -F %S/Inputs -DBLARG -DWIBBLE=WOBBLE -fmodule-feature myfeature %s -// RUN: %clang_cc1 -module-file-info %t-obj/DependsOnModule.pcm | FileCheck %s -// RUN: %clang_cc1 -module-file-info %t-obj/DependsOnModule.pcm | FileCheck %s --check-prefix=OBJ +// RUN: %clang -module-file-info %t-obj/DependsOnModule.pcm | FileCheck %s +// RUN: %clang -module-file-info %t-obj/DependsOnModule.pcm | FileCheck %s --check-prefix=OBJ // RAW: Module format: raw // OBJ: Module format: obj