[ClangScanDeps][test] Add -fmodules-cache-path=DIR/cache to make diagnostics.c hermetic
authorFangrui Song <i@maskray.me>
Mon, 13 Sep 2021 20:17:55 +0000 (13:17 -0700)
committerFangrui Song <i@maskray.me>
Mon, 13 Sep 2021 20:17:55 +0000 (13:17 -0700)
commit0867c017e55e3a3d457f26bb778a2cd80d86e1f4
treee2e90890da102aef5dd84e3872b5b7ee55f938ee
parentdc08cfae091df6fdd625ebb2c5b047b3c96000d8
[ClangScanDeps][test] Add -fmodules-cache-path=DIR/cache to make diagnostics.c hermetic

Otherwise it may access sys::path::cache_directory/clang/ModuleCache which may not be writable.
clang/test/ClangScanDeps/Inputs/diagnostics/cdb.json.template