85 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: sed -e "s|DIR|%/t|g" %t/build/compile-commands.json.in > %t/build/compile-commands.json4// RUN: sed -e "s|DIR|%/t|g" %t/build/vfsoverlay.yaml.in > %t/build/vfsoverlay.yaml5// RUN: sed -e "s|DIR|%/t|g" %t/build/vfs.notyaml.in > %t/build/vfs.notyaml6// 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.db8 9// RUN: %deps-to-rsp %t/deps.db --module-name=A > %t/A.rsp10// RUN: cd %t && %clang @%t/A.rsp11 12// Check that the following edge cases are handled by ivfsoverlay tracking13// * `-ivfsoverlay` args that depend on earlier `-ivfsoverlay` args.14 15//--- build/compile-commands.json.in16 17[18{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"22}23]24 25//--- build/vfsoverlay.yaml.in26 27{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 ]43}44 45//--- build/vfs.notyaml.in46 47{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 ]68}69 70//--- build/module.modulemap71 72module A {73 umbrella header "A.h"74}75 76//--- build/A.h77 78typedef int A_t;79 80//--- 0.m81 82#include <A.h>83 84A_t a = 0;85