[RISCV] Rename a lambda to have plural nouns to reflect that it contains a loop. NFC
[llvm-project.git] / clang / test / ClangScanDeps / modules-symlink.c
blobe4983bc6d0ccec585cc2d672a5f6c16ee1affa90
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // Unsupported on AIX because we don't support the requisite "__clangast"
4 // section in XCOFF yet.
5 // UNSUPPORTED: system-windows, target={{.*}}-aix{{.*}}
7 //--- cdb_pch.json
10 "directory": "DIR",
11 "command": "clang -x c-header DIR/pch.h -fmodules -gmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache -o DIR/pch.h.gch",
12 "file": "DIR/pch.h"
16 //--- cdb_tu.json
19 "directory": "DIR",
20 "command": "clang -c DIR/tu.c -fmodules -gmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache -include DIR/pch.h -o DIR/tu.o",
21 "file": "DIR/tu.c"
25 //--- module.modulemap
26 module mod { header "symlink.h" }
28 //--- pch.h
29 #include "symlink.h"
31 //--- original.h
32 // Comment that will be stripped by the minimizer.
33 #define MACRO 1
35 //--- tu.c
36 #include "original.h"
37 static int foo = MACRO; // Macro usage that will trigger
38 // input file consistency checks.
40 // RUN: ln -s %t/original.h %t/symlink.h
42 // RUN: sed -e "s|DIR|%/t|g" %t/cdb_pch.json > %t/cdb.json
43 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
44 // RUN: -module-files-dir %t/build > %t/result_pch.json
46 // RUN: %deps-to-rsp %t/result_pch.json --module-name=mod > %t/mod.cc1.rsp
47 // RUN: %deps-to-rsp %t/result_pch.json --tu-index=0 > %t/pch.rsp
49 // RUN: %clang @%t/mod.cc1.rsp
50 // RUN: %clang @%t/pch.rsp
52 // RUN: sed -e "s|DIR|%/t|g" %t/cdb_tu.json > %t/cdb.json
53 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
54 // RUN: -module-files-dir %t/build > %t/result_tu.json