[flang] Fix crash in HLFIR generation (#118399)
[llvm-project.git] / clang / test / ClangScanDeps / diagnostic-pragmas.c
blob520f82047d2b12f4f9b4b937d87b584af93b8db3
1 // Test scanning deps does not have more errors than the regular compilation.
3 // RUN: rm -rf %t
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
16 "directory": "DIR",
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",
18 "file": "DIR/test.c"
22 //--- include/nonmodular.h
23 // empty
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" }
34 //--- test.c
35 #include <modular-includer.h>