[PATCH] D53334: [Frontend/Modules] Show diagnostics on prebuilt module configuration mismatch too
Whisperity via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 6 03:23:06 PST 2018
whisperity planned changes to this revision.
whisperity added a comment.
In https://reviews.llvm.org/D53334#1288057, @dblaikie wrote:
> In https://reviews.llvm.org/D53334#1273877, @whisperity wrote:
> > @dblaikie I have created a test, but unfortunately `%clang_cpp` in LIT invokes `clang --driver-mode=cpp` which is not the same as if `clang++` is called. I'm trying to construct the following command-line
> > `clang++ -fmodules-ts -fprebuilt-module-path=%t/mods --precompile -c file.cppm -o file.pcm`
> > However, using `%clang_cc1` I can't get it to accept `--precompile` as a valid argument, and using `%clang_cpp` I get an "unused argument" warning for `--precompile` and the output file is just a preprocessed output (like `-E`), which will, of course, cause errors, but not the errors I am wanting to test about.
> Hey, sorry for the delay - you can use "clang -### <other arguments>" (or "clang++ -### <other arguments>" to get clang to print out the underlying -cc1 command line that is used.
> If you're changing the driver then we'd write a driver test (that tests that, given "clang -foo -###" it produces some "clang -cc1 -bar" command line to run the frontend.
> But since you're changing the driver, it's not interesting to (re) test how --precompile is lowered from the driver to cc1. Instead we test the frontend (cc1) directly.
Understood, thank you for the help, I'll try looking into this. It was just at first a strange behaviour to see that conventionally an external call command messes up and behaves different.
Until then I'll re-mark this as a WIP because the tests are half-baked anyways.
More information about the cfe-commits