58 lines · c
1// RUN: rm -rf %t2// RUN: split-file %s %t3 4// RUN: sed -e "s|DIR|%/t|g" %t/vfs.yaml.in > %t/vfs.yaml5 6// RUN: clang-scan-deps -format experimental-full -j 1 -- \7// RUN: %clang -ivfsoverlay %t/vfs.yaml -fmodules -fimplicit-module-maps \8// RUN: -fmodules-cache-path=%t/cache -fmodule-name=ModuleName \9// RUN: -I %/t/remapped -c %t/header-impl.c -o %t/header-impl.o \10// RUN: | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t11 12// CHECK: "command-line": [13// CHECK: "-fmodule-map-file=[[PREFIX]]/remapped/module.modulemap"14// CHECK: "file-deps": [15// CHECK: "[[PREFIX]]/original/module.modulemap"16 17// Verify that "file-deps" references actual on-disk module map and not using the virtual path.18 19//--- vfs.yaml.in20{21 "version": 0,22 "case-sensitive": "false",23 "roots": [24 {25 "name": "DIR/remapped",26 "type": "directory",27 "contents": [28 {29 "name": "module.modulemap",30 "type": "file",31 "external-contents": "DIR/original/module.modulemap"32 },33 {34 "name": "header.h",35 "type": "file", 36 "external-contents": "DIR/original/header.h"37 }38 ]39 }40 ]41}42 43//--- original/module.modulemap44module ModuleName {45 header "header.h"46 export *47}48 49//--- original/header.h50int foo_function(void);51 52//--- header-impl.c53#include <header.h>54 55int foo_function(void) {56 return 0;57}58