2 // RUN: rm -rf %t.mcp %t
4 // RUN: ln -s %S/Inputs/NameInDir2.framework %t/NameInImport.framework
5 // RUN: ln -s %S/Inputs/NameInDirInferred.framework %t/NameInImportInferred.framework
6 // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t.mcp -fimplicit-module-maps -I %S/Inputs -F %S/Inputs -F %t -Wauto-import -verify %s
8 // Verify that we won't somehow find non-canonical module names or modules where
9 // we shouldn't search the framework.
10 // RUN: echo '@import NameInModMap;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Wauto-import -x objective-c - 2>&1 | FileCheck %s
11 // RUN: echo '@import NameInDir;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Wauto-import -x objective-c - 2>&1 | FileCheck %s
12 // RUN: echo '@import NameInImport;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Wauto-import -x objective-c - 2>&1 | FileCheck %s
13 // RUN: echo '@import NameInImportInferred;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Wauto-import -x objective-c - 2>&1 | FileCheck %s
14 // CHECK: module '{{.*}}' not found
16 // FIXME: We might want to someday lock down framework modules so that these
17 // name mismatches are disallowed. However, as long as we *don't* prevent them
18 // it's important that they map correctly to module imports.
20 // The module map name doesn't match the directory name.
21 #import <NameInDir/NameInDir.h> // expected-warning {{import of module 'NameInModMap'}}
23 // The name in the import doesn't match the module name.
24 #import <NameInImport/NameInDir2.h> // expected-warning {{import of module 'NameInDir2'}}
25 @import NameInDir2; // OK
27 // The name in the import doesn't match the module name (inferred framework module).
28 #import <NameInImportInferred/NameInDirInferred.h> // expected-warning {{import of module 'NameInDirInferred'}}
30 @import ImportNameInDir;
32 #error NAME_IN_DIR should be undef'd