1// RUN: cd %S 2// RUN: rm -rf %t 3// 4// RUN: %clang_cc1 -I. -x c++ -fmodule-name=test -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse %s -dependency-file - -MT implicit.pcm -o %t/implicit.pcm -fmodules-cache-path=%t -fmodule-map-file-home-is-cwd | FileCheck %s --check-prefix=IMPLICIT 5// 6// RUN: %clang_cc1 -I. -x c++ -fmodule-name=test-base -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse Inputs/dependency-gen-base.modulemap -o %t/base.pcm -fmodule-map-file-home-is-cwd 7// RUN: %clang_cc1 -I. -x c++ -fmodule-name=test -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse -fmodule-file=%t/base.pcm %s -dependency-file - -MT explicit.pcm -o %t/explicit.pcm -fmodules-cache-path=%t -fmodule-map-file-home-is-cwd | FileCheck %s --check-prefix=EXPLICIT 8module "test" { 9 export * 10 header "Inputs/dependency-gen.h" 11 use "test-base" 12 use "test-base2" 13} 14extern module "test-base2" "Inputs/dependency-gen-base2.modulemap" 15extern module "test-base" "Inputs/dependency-gen-base.modulemap" 16 17// For implicit use of a module via the module cache, the input files 18// referenced by the .pcm are also dependencies of this build. 19// 20// IMPLICIT-DAG: {{[/\\]}}dependency-gen.modulemap 21// IMPLICIT-DAG: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen-base.modulemap 22// IMPLICIT-DAG: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen-base2.modulemap 23// IMPLICIT-DAG: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen.h 24// IMPLICIT-DAG: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen-included.h 25// IMPLICIT-DAG: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen-included2.h 26 27// For an explicit use of a module via -fmodule-file=, the other module maps 28// and included headers are not dependencies of this target (they are instead 29// dependencies of the explicitly-specified .pcm input). 30// 31// FIXME: We should avoid loading the other referenced module maps (we already 32// have a parsed copy of their contents from the .pcm file) and thus not list 33// them here. 34// 35// FIXME: We should list a dependency on the explicitly specified .pcm files 36// (whether or not -module-file-deps is specified on the command line). 37// 38// EXPLICIT-FIXME-NOT: dependency-gen- 39// EXPLICIT-FIXME: {{.*}}/base.pcm 40// 41// EXPLICIT: {{^}}explicit.pcm: 42// EXPLICIT: {{.*}}/dependency-gen.modulemap 43// EXPLICIT: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen.h 44