1 // Test scanning deps does not have more errors than the regular compilation.
4 // RUN: split-file %s %t
5 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
7 // Check the regular compilation does not fail.
8 // RUN: %clang -fsyntax-only %t/test.c -I %t/include -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -Wnon-modular-include-in-module -Werror=non-modular-include-in-module
10 // And now scanning deps should succeed too.
11 // RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1
13 //--- cdb.json.template
17 "command": "clang -fsyntax-only DIR/test.c -I DIR/include -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache -Wnon-modular-include-in-module -Werror=non-modular-include-in-module",
22 //--- include/nonmodular.h
25 //--- include/modular-includer.h
26 #pragma clang diagnostic push
27 #pragma clang diagnostic ignored "-Wnon-modular-include-in-module"
28 #include <nonmodular.h>
29 #pragma clang diagnostic pop
31 //--- include/module.modulemap
32 module ModularIncluder
{ header
"modular-includer.h" }
35 #include <modular-includer.h>