beanz updated this revision to Diff 349350. beanz added a comment. Breaking out a separate test case.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103547/new/ https://reviews.llvm.org/D103547 Files: clang/lib/Driver/Driver.cpp clang/test/Modules/clang_module_file_info.m Index: clang/test/Modules/clang_module_file_info.m =================================================================== --- /dev/null +++ clang/test/Modules/clang_module_file_info.m @@ -0,0 +1,16 @@ + +@import DependsOnModule; + +// RUN: rm -rf %t %t-obj +// 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 -module-file-info %t-obj/DependsOnModule.pcm | FileCheck %s +// RUN: %clang -module-file-info %t-obj/DependsOnModule.pcm | FileCheck %s + +// This test is just verifying that the clang driver doesn't delete the input +// file when -module-file-info is passed. We verify this by dumping the module +// twice subsequently. We have other tests to verify the contents of the module +// and the tool output (see: module_file_info.m) + +// CHECK: Generated by this Clang: + +// CHECK: Module name: DependsOnModule Index: clang/lib/Driver/Driver.cpp =================================================================== --- clang/lib/Driver/Driver.cpp +++ 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) ||
Index: clang/test/Modules/clang_module_file_info.m =================================================================== --- /dev/null +++ clang/test/Modules/clang_module_file_info.m @@ -0,0 +1,16 @@ + +@import DependsOnModule; + +// RUN: rm -rf %t %t-obj +// 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 -module-file-info %t-obj/DependsOnModule.pcm | FileCheck %s +// RUN: %clang -module-file-info %t-obj/DependsOnModule.pcm | FileCheck %s + +// This test is just verifying that the clang driver doesn't delete the input +// file when -module-file-info is passed. We verify this by dumping the module +// twice subsequently. We have other tests to verify the contents of the module +// and the tool output (see: module_file_info.m) + +// CHECK: Generated by this Clang: + +// CHECK: Module name: DependsOnModule Index: clang/lib/Driver/Driver.cpp =================================================================== --- clang/lib/Driver/Driver.cpp +++ 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) ||
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits