2 // RUN: split-file %s %t
3 // RUN: sed -e "s;TEST_DIR;%/t;g" %t/sed-overlay.yaml > %t/overlay.yaml
5 // These tests first build with an overlay such that the header is resolved
6 // to %t/other/Mismatch.h. They then build again with the header resolved
7 // to the one in their directory.
9 // This should cause a rebuild if the contents is different (and thus multiple
10 // PCMs), but this currently isn't the case. We should at least not error,
11 // since this does happen in real projects (with a different copy of the same
14 // RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/hf-mcp -ivfsoverlay %t/overlay.yaml -F %t/header-frameworks -fsyntax-only -verify %t/use.m
15 // RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/hf-mcp -F %t/header-frameworks -fsyntax-only -verify %t/use.m
16 // RUN: find %t/hf-mcp -name "Mismatch-*.pcm" | count 1
18 // RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/df-mcp -ivfsoverlay %t/overlay.yaml -F %t/dir-frameworks -fsyntax-only -verify %t/use.m
19 // RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/hf-mcp -F %t/dir-frameworks -fsyntax-only -verify %t/use.m
20 // RUN: find %t/df-mcp -name "Mismatch-*.pcm" | count 1
22 // RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/nf-mcp -ivfsoverlay %t/overlay.yaml -F %t/norm-frameworks -fsyntax-only -verify %t/use.m
23 // RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/nf-mcp -F %t/norm-frameworks -fsyntax-only -verify %t/use.m
24 // RUN: find %t/nf-mcp -name "Mismatch-*.pcm" | count 1
26 // RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/m-mcp -ivfsoverlay %t/overlay.yaml -I %t/mod -fsyntax-only -verify %t/use.m
27 // RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/m-mcp -I %t/mod -fsyntax-only -verify %t/use.m
28 // RUN: find %t/m-mcp -name "Mismatch-*.pcm" | count 1
31 // expected-no-diagnostics
34 //--- header-frameworks/Mismatch.framework/Modules/module.modulemap
35 framework module Mismatch {
36 umbrella header "Mismatch.h"
38 //--- header-frameworks/Mismatch.framework/Headers/Mismatch.h
40 //--- dir-frameworks/Mismatch.framework/Modules/module.modulemap
41 framework module Mismatch {
42 umbrella "someheaders"
44 //--- dir-frameworks/Mismatch.framework/someheaders/Mismatch.h
46 //--- norm-frameworks/Mismatch.framework/Modules/module.modulemap
47 framework module Mismatch {
50 //--- norm-frameworks/Mismatch.framework/Headers/Mismatch.h
52 //--- mod/module.modulemap
54 umbrella header "Mismatch.h"
58 //--- other/Mismatch.h
60 //--- sed-overlay.yaml
64 { 'name': 'TEST_DIR', 'type': 'directory',
66 { 'name': 'header-frameworks/Mismatch.framework/Headers/Mismatch.h',
68 'external-contents': 'TEST_DIR/other/Mismatch.h'
70 { 'name': 'dir-frameworks/Mismatch.framework/someheaders',
72 'external-contents': 'TEST_DIR/others'
74 { 'name': 'norm-frameworks/Mismatch.framework/Headers/Mismatch.h',
76 'external-contents': 'TEST_DIR/other/Mismatch.h'
78 { 'name': 'mod/Mismatch.h',
80 'external-contents': 'TEST_DIR/other/Mismatch.h'