brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 3e0c459 Raw
35 lines · plain
1// REQUIRES: symlinks2 3// RUN: rm -rf %t.mcp %t4// RUN: mkdir -p %t5// RUN: ln -s %S/Inputs/NameInDir2.framework %t/NameInImport.framework6// RUN: ln -s %S/Inputs/NameInDirInferred.framework %t/NameInImportInferred.framework7// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t.mcp -fimplicit-module-maps -I %S/Inputs -F %S/Inputs -F %t -Rmodule-include-translation -verify %s8 9// Verify that we won't somehow find non-canonical module names or modules where10// we shouldn't search the framework.11// RUN: echo '@import NameInModMap;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Rmodule-include-translation -x objective-c - 2>&1 | FileCheck %s12// RUN: echo '@import NameInDir;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Rmodule-include-translation -x objective-c - 2>&1 | FileCheck %s13// RUN: echo '@import NameInImport;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Rmodule-include-translation -x objective-c - 2>&1 | FileCheck %s14// RUN: echo '@import NameInImportInferred;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Rmodule-include-translation -x objective-c - 2>&1 | FileCheck %s15// CHECK: module '{{.*}}' not found16 17// FIXME: We might want to someday lock down framework modules so that these18// name mismatches are disallowed. However, as long as we *don't* prevent them19// it's important that they map correctly to module imports.20 21// The module map name doesn't match the directory name.22#import <NameInDir/NameInDir.h> // expected-remark {{import of module 'NameInModMap'}}23 24// The name in the import doesn't match the module name.25#import <NameInImport/NameInDir2.h> // expected-remark {{import of module 'NameInDir2'}}26@import NameInDir2;                 // OK27 28// The name in the import doesn't match the module name (inferred framework module).29#import <NameInImportInferred/NameInDirInferred.h> // expected-remark {{import of module 'NameInDirInferred'}}30 31@import ImportNameInDir;32#ifdef NAME_IN_DIR33#error NAME_IN_DIR should be undef'd34#endif35