[PATCH] D53334: [Frontend/Modules] Show diagnostics on prebuilt module configuration mismatch too

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 5 16:39:23 PST 2018


dblaikie added a comment.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D53334





More information about the cfe-commits mailing list