56 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3 4//--- this/module.modulemap5module This { header "This.h" }6//--- this/This.h7#include "Foo.h"8#include "Foo_Private_Excluded.h"9 10//--- modules/module.modulemap11module Foo { header "Foo.h" }12//--- modules/module.private.modulemap13explicit module Foo.Private {14 header "Foo_Private.h"15 exclude header "Foo_Private_Excluded.h"16}17//--- modules/Foo.h18//--- modules/Foo_Private.h19//--- modules/Foo_Private_Excluded.h20 21//--- cdb.json.template22[{23 "file": "DIR/tu.m",24 "directory": "DIR",25 "command": "clang -fmodules -fmodules-cache-path=DIR/cache -I DIR/this -I DIR/modules -c DIR/tu.m -o DIR/tu.o"26}]27 28//--- tu.m29@import This;30 31// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json32// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/result.json33 34// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t35// CHECK: {36// CHECK-NEXT: "modules": [37// CHECK-NEXT: {38// CHECK: },39// CHECK-NEXT: {40// CHECK: "command-line": [41// CHECK: "-fmodule-map-file=[[PREFIX]]/modules/module.modulemap",42// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/modules/module.private.modulemap",43// CHECK: ],44// CHECK: "name": "This"45// CHECK-NEXT: }46// CHECK-NEXT: ]47// CHECK: }48 49// RUN: %deps-to-rsp %t/result.json --module-name=Foo > %t/Foo.cc1.rsp50// RUN: %deps-to-rsp %t/result.json --module-name=This > %t/This.cc1.rsp51// RUN: %deps-to-rsp %t/result.json --tu-index=0 > %t/tu.rsp52 53// RUN: %clang @%t/Foo.cc1.rsp54// RUN: %clang @%t/This.cc1.rsp55// RUN: %clang @%t/tu.rsp56