Fix some typos (#123506)
[llvm-project.git] / clang / test / ClangScanDeps / optimize-vfs-edgecases.m
blob0f18571dd05b23003cf83814ca3dffa19a6cade6
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: sed -e "s|DIR|%/t|g" %t/build/compile-commands.json.in > %t/build/compile-commands.json
4 // RUN: sed -e "s|DIR|%/t|g" %t/build/vfsoverlay.yaml.in > %t/build/vfsoverlay.yaml
5 // RUN: sed -e "s|DIR|%/t|g" %t/build/vfs.notyaml.in > %t/build/vfs.notyaml
6 // RUN: clang-scan-deps -compilation-database %t/build/compile-commands.json \
7 // RUN:   -j 1 -format experimental-full --optimize-args=vfs,header-search > %t/deps.db
9 // RUN: %deps-to-rsp %t/deps.db --module-name=A > %t/A.rsp
10 // RUN: cd %t && %clang @%t/A.rsp
12 // Check that the following edge cases are handled by ivfsoverlay tracking
13 // * `-ivfsoverlay` args that depend on earlier `-ivfsoverlay` args.
15 //--- build/compile-commands.json.in
19   "directory": "DIR",
20   "command": "clang -c DIR/0.m -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-module-maps -ivfsoverlay build/vfsoverlay.yaml -ivfsoverlay build/vfs.yaml",
21   "file": "DIR/0.m"
25 //--- build/vfsoverlay.yaml.in
28    "version":0,
29    "case-sensitive":"false",
30    "roots":[
31       {
32          "contents":[
33             {
34                "external-contents":"DIR/build/vfs.notyaml",
35                "name":"vfs.yaml",
36                "type":"file"
37             }
38          ],
39          "name":"DIR/build",
40          "type":"directory"
41       }
42    ]
45 //--- build/vfs.notyaml.in
48    "version":0,
49    "case-sensitive":"false",
50    "roots":[
51       {
52          "contents":[
53             {
54                "external-contents":"DIR/build/module.modulemap",
55                "name":"module.modulemap",
56                "type":"file"
57             },
58             {
59                "external-contents":"DIR/build/A.h",
60                "name":"A.h",
61                "type":"file"
62             }
63          ],
64          "name":"DIR/modules/A",
65          "type":"directory"
66       }
67    ]
70 //--- build/module.modulemap
72 module A {
73   umbrella header "A.h"
76 //--- build/A.h
78 typedef int A_t;
80 //--- 0.m
82 #include <A.h>
84 A_t a = 0;