Richard Smith | 223d3f2 | 2014-12-06 03:21:08 +0000 | [diff] [blame] | 1 | // RUN: cd %S |
| 2 | // RUN: rm -rf %t |
| 3 | // RUN: mkdir %t |
Richard Smith | 9acb99e3 | 2014-12-10 03:09:48 +0000 | [diff] [blame] | 4 | // |
Chandler Carruth | 580dd29 | 2015-03-24 21:44:25 +0000 | [diff] [blame] | 5 | // RUN: %clang_cc1 -cc1 -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 |
| 6 | // RUN: %clang_cc1 -cc1 -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 |
| 7 | // RUN: %clang_cc1 -cc1 -fno-implicit-modules -fmodule-map-file=Inputs/relative-dep-gen.modulemap -dependency-file %t/use-implicit.d relative-dep-gen.cpp -MT use.o -fsyntax-only |
Richard Smith | 223d3f2 | 2014-12-06 03:21:08 +0000 | [diff] [blame] | 8 | // |
| 9 | // RUN: FileCheck --check-prefix=CHECK-BUILD %s < %t/build.d |
| 10 | // RUN: FileCheck --check-prefix=CHECK-USE %s < %t/use-explicit.d |
| 11 | // RUN: FileCheck --check-prefix=CHECK-USE %s < %t/use-implicit.d |
Richard Smith | 9acb99e3 | 2014-12-10 03:09:48 +0000 | [diff] [blame] | 12 | // |
Chandler Carruth | 580dd29 | 2015-03-24 21:44:25 +0000 | [diff] [blame] | 13 | // RUN: %clang_cc1 -cc1 -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 |
| 14 | // RUN: %clang_cc1 -cc1 -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 |
| 15 | // RUN: %clang_cc1 -cc1 -fno-implicit-modules -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 |
Richard Smith | 9acb99e3 | 2014-12-10 03:09:48 +0000 | [diff] [blame] | 16 | // |
| 17 | // RUN: FileCheck --check-prefix=CHECK-BUILD %s < %t/build-cwd.d |
| 18 | // RUN: FileCheck --check-prefix=CHECK-USE %s < %t/use-explicit-cwd.d |
| 19 | // RUN: FileCheck --check-prefix=CHECK-USE %s < %t/use-implicit-cwd.d |
Richard Smith | f7b4137 | 2015-08-13 23:47:44 +0000 | [diff] [blame] | 20 | // |
| 21 | // Check that the .d file is still correct after relocating the module. |
| 22 | // RUN: mkdir %t/Inputs |
| 23 | // RUN: cp %S/Inputs/relative-dep-gen-1.h %t/Inputs |
| 24 | // RUN: cp %s %t |
| 25 | // RUN: cd %t |
| 26 | // RUN: %clang_cc1 -cc1 -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 |
| 27 | // RUN: cat %t/use-explicit-no-map-cwd.d |
| 28 | // RUN: FileCheck --check-prefix=CHECK-USE %s < %t/use-explicit-no-map-cwd.d |
Richard Smith | 223d3f2 | 2014-12-06 03:21:08 +0000 | [diff] [blame] | 29 | |
| 30 | #include "Inputs/relative-dep-gen-1.h" |
| 31 | |
Richard Smith | 2a6edb3 | 2015-08-09 04:46:57 +0000 | [diff] [blame] | 32 | // CHECK-BUILD: mod.pcm: |
Richard Smith | f7b4137 | 2015-08-13 23:47:44 +0000 | [diff] [blame] | 33 | // CHECK-BUILD: {{[ \t]}}Inputs/relative-dep-gen{{(-cwd)?}}.modulemap |
| 34 | // CHECK-BUILD: {{[ \t]}}Inputs/relative-dep-gen-1.h |
| 35 | // CHECK-BUILD: {{[ \t]}}Inputs/relative-dep-gen-2.h |
Richard Smith | 2a6edb3 | 2015-08-09 04:46:57 +0000 | [diff] [blame] | 36 | // CHECK-USE: use.o: |
Richard Smith | f7b4137 | 2015-08-13 23:47:44 +0000 | [diff] [blame] | 37 | // CHECK-USE-DAG: {{[ \t]}}relative-dep-gen.cpp |
| 38 | // CHECK-USE-DAG: {{[ \t]}}Inputs{{[/\\]}}relative-dep-gen-1.h |