2014-12-06 11:21:08 +08:00
|
|
|
// RUN: cd %S
|
|
|
|
// RUN: rm -rf %t
|
|
|
|
// RUN: mkdir %t
|
2014-12-10 11:09:48 +08:00
|
|
|
//
|
2017-07-07 05:05:56 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules -fno-implicit-modules -fmodule-name=relative-dep-gen -emit-module -x c++ Inputs/relative-dep-gen.modulemap -dependency-file %t/build.d -MT mod.pcm -o %t/mod.pcm
|
|
|
|
// RUN: %clang_cc1 -fmodules -fno-implicit-modules -fmodule-map-file=Inputs/relative-dep-gen.modulemap -fmodule-file=%t/mod.pcm -dependency-file %t/use-explicit.d -MT use.o relative-dep-gen.cpp -fsyntax-only
|
|
|
|
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodule-map-file=Inputs/relative-dep-gen.modulemap -dependency-file %t/use-implicit.d relative-dep-gen.cpp -MT use.o -fsyntax-only
|
2014-12-06 11:21:08 +08:00
|
|
|
//
|
|
|
|
// RUN: FileCheck --check-prefix=CHECK-BUILD %s < %t/build.d
|
2017-07-07 05:05:56 +08:00
|
|
|
// RUN: FileCheck --check-prefix=CHECK-USE --check-prefix=CHECK-EXPLICIT %s < %t/use-explicit.d
|
|
|
|
// RUN: FileCheck --check-prefix=CHECK-USE --check-prefix=CHECK-IMPLICIT %s < %t/use-implicit.d
|
2014-12-10 11:09:48 +08:00
|
|
|
//
|
2017-07-07 05:05:56 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules -fno-implicit-modules -fmodule-name=relative-dep-gen -emit-module -x c++ Inputs/relative-dep-gen-cwd.modulemap -dependency-file %t/build-cwd.d -MT mod.pcm -o %t/mod-cwd.pcm -fmodule-map-file-home-is-cwd
|
|
|
|
// RUN: %clang_cc1 -fmodules -fno-implicit-modules -fmodule-map-file=Inputs/relative-dep-gen-cwd.modulemap -fmodule-file=%t/mod-cwd.pcm -dependency-file %t/use-explicit-cwd.d -MT use.o relative-dep-gen.cpp -fsyntax-only -fmodule-map-file-home-is-cwd
|
|
|
|
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodule-map-file=Inputs/relative-dep-gen-cwd.modulemap -dependency-file %t/use-implicit-cwd.d relative-dep-gen.cpp -MT use.o -fsyntax-only -fmodule-map-file-home-is-cwd
|
2014-12-10 11:09:48 +08:00
|
|
|
//
|
|
|
|
// RUN: FileCheck --check-prefix=CHECK-BUILD %s < %t/build-cwd.d
|
|
|
|
// RUN: FileCheck --check-prefix=CHECK-USE %s < %t/use-explicit-cwd.d
|
|
|
|
// RUN: FileCheck --check-prefix=CHECK-USE %s < %t/use-implicit-cwd.d
|
2015-08-14 07:47:44 +08:00
|
|
|
//
|
|
|
|
// Check that the .d file is still correct after relocating the module.
|
|
|
|
// RUN: mkdir %t/Inputs
|
|
|
|
// RUN: cp %S/Inputs/relative-dep-gen-1.h %t/Inputs
|
|
|
|
// RUN: cp %s %t
|
|
|
|
// RUN: cd %t
|
2017-07-07 05:05:56 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules -fno-implicit-modules -fmodule-file=%t/mod-cwd.pcm -dependency-file %t/use-explicit-no-map-cwd.d -MT use.o relative-dep-gen.cpp -fsyntax-only -fmodule-map-file-home-is-cwd
|
2015-08-14 07:47:44 +08:00
|
|
|
// RUN: cat %t/use-explicit-no-map-cwd.d
|
|
|
|
// RUN: FileCheck --check-prefix=CHECK-USE %s < %t/use-explicit-no-map-cwd.d
|
2014-12-06 11:21:08 +08:00
|
|
|
|
|
|
|
#include "Inputs/relative-dep-gen-1.h"
|
|
|
|
|
2015-08-09 12:46:57 +08:00
|
|
|
// CHECK-BUILD: mod.pcm:
|
2015-08-14 07:47:44 +08:00
|
|
|
// CHECK-BUILD: {{[ \t]}}Inputs/relative-dep-gen{{(-cwd)?}}.modulemap
|
|
|
|
// CHECK-BUILD: {{[ \t]}}Inputs/relative-dep-gen-1.h
|
|
|
|
// CHECK-BUILD: {{[ \t]}}Inputs/relative-dep-gen-2.h
|
2015-08-09 12:46:57 +08:00
|
|
|
// CHECK-USE: use.o:
|
2015-08-14 07:47:44 +08:00
|
|
|
// CHECK-USE-DAG: {{[ \t]}}relative-dep-gen.cpp
|
2017-07-07 05:05:56 +08:00
|
|
|
// CHECK-EXPLICIT-DAG: mod.pcm
|
|
|
|
// CHECK-IMPLICIT-DAG: {{[ \t]}}Inputs{{[/\\]}}relative-dep-gen-1.h
|