blob: 04c6caf24dec20116fa21e657c19a630a860d7ca [file] [log] [blame]
Bruno Cardoso Lopesa66a3252017-11-17 03:24:11 +00001// RUN: rm -rf %t.dst %t.cache
2// RUN: mkdir -p %t.dst/folder-with-modulemap %t.dst/pch-folder
3// RUN: echo '#import "folder-with-modulemap/included.h"' > %t.dst/header.h
4// RUN: echo 'extern int MyModuleVersion;' > %t.dst/folder-with-modulemap/MyModule.h
5// RUN: echo '@import MyModule;' > %t.dst/folder-with-modulemap/included.h
6// RUN: echo 'module MyModule { header "MyModule.h" }' > %t.dst/folder-with-modulemap/module.modulemap
7
8// RUN: %clang -o %t.dst/pch-folder/header.pch -x objective-c-header -fmodules-cache-path=%t.cache -fmodules %t.dst/header.h
9// RUN: not %clang -fsyntax-only -fmodules-cache-path=%t.cache -fmodules %s -include-pch %t.dst/pch-folder/header.pch 2>&1 | FileCheck %s
10
11void test() {
12 (void)MyModuleVersion; // should be found by implicit import
13}
14
Bruno Cardoso Lopesb5b0c022017-11-17 04:26:07 +000015// CHECK: module 'MyModule' in AST file '{{.*MyModule.*pcm}}' (imported by AST file '[[PCH:.*header.pch]]') is not defined in any loaded module map file; maybe you need to load '[[PATH:.*folder-with-modulemap]]
Bruno Cardoso Lopesa66a3252017-11-17 03:24:11 +000016// CHECK: consider adding '[[PATH]]' to the header search path
17// CHECK: imported by '[[PCH]]'