|
3 | 3 |
|
4 | 4 | // RUN: rm -rf %t
|
5 | 5 | // RUN: mkdir -p %t
|
6 |
| -// This could be replaced by diamond_*, except we want to modify the top header |
7 |
| -// RUN: echo '@import l; @import r;' > %t/b.h |
8 |
| -// RUN: echo '@import t; // fromt l' > %t/l.h |
9 |
| -// RUN: echo '@import t; // fromt r' > %t/r.h |
| 6 | +// RUN: split-file %s %t |
10 | 7 |
|
11 |
| -// RUN: echo '// top' > %t/t.h-1 |
12 | 8 | // RUN: cat %t/t.h-1 > %t/t.h
|
13 | 9 |
|
14 |
| -// RUN: echo 'module b { header "b.h" } module l { header "l.h" }' > %t/module.modulemap-1 |
15 |
| -// RUN: echo 'module r { header "r.h" } module t { header "t.h" }' > %t/module.modulemap-2 |
16 |
| -// RUN: cat %t/module.modulemap-1 %t/module.modulemap-2 > %t/module.modulemap |
17 |
| - |
18 | 10 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
|
19 |
| -// RUN: -I %t -fsyntax-only %s -Rmodule-build 2>&1 \ |
20 |
| -// RUN: | FileCheck -check-prefix=REBUILD-ALL %s |
| 11 | +// RUN: -I %t -fsyntax-only %t/main.m -Rmodule-build 2>&1 \ |
| 12 | +// RUN: | FileCheck -check-prefix=REBUILD-ALL %t/main.m |
21 | 13 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
|
22 |
| -// RUN: -I %t -fsyntax-only %s -Rmodule-build -verify |
| 14 | +// RUN: -I %t -fsyntax-only %t/main.m -Rmodule-build -verify |
23 | 15 |
|
24 | 16 | // Add an identifier to ensure everything depending on t is out of date
|
25 |
| -// RUN: echo 'extern int a;' > %t/t.h-2 |
26 | 17 | // RUN: cat %t/t.h-1 %t/t.h-2 > %t/t.h
|
27 | 18 |
|
28 | 19 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
|
29 |
| -// RUN: -I %t -fsyntax-only %s -Rmodule-build 2>&1 \ |
30 |
| -// RUN: | FileCheck -check-prefix=REBUILD-ALL %s |
| 20 | +// RUN: -I %t -fsyntax-only %t/main.m -Rmodule-build 2>&1 \ |
| 21 | +// RUN: | FileCheck -check-prefix=REBUILD-ALL %t/main.m |
31 | 22 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
|
32 |
| -// RUN: -I %t -fsyntax-only %s -Rmodule-build -verify |
| 23 | +// RUN: -I %t -fsyntax-only %t/main.m -Rmodule-build -verify |
| 24 | + |
| 25 | +//--- b.h |
| 26 | +@import l; @import r; |
| 27 | + |
| 28 | +//--- l.h |
| 29 | +@import t; // fromt l |
| 30 | + |
| 31 | +//--- r.h |
| 32 | +@import t; // fromt r |
| 33 | + |
| 34 | +//--- t.h-1 |
| 35 | +// top |
| 36 | + |
| 37 | +//--- t.h-2 |
| 38 | +extern int a; |
| 39 | + |
| 40 | +//--- module.modulemap |
| 41 | +module b { header "b.h" } module l { header "l.h" } |
| 42 | +module r { header "r.h" } module t { header "t.h" } |
| 43 | + |
| 44 | +//--- main.m |
33 | 45 |
|
34 | 46 | // REBUILD-ALL: building module 'b'
|
35 | 47 | // REBUILD-ALL: building module 'l'
|
|
38 | 50 |
|
39 | 51 | // Use -verify when expecting no modules to be rebuilt.
|
40 | 52 | // expected-no-diagnostics
|
41 |
| - |
42 | 53 | @import b;
|
0 commit comments