Ben Langmuir | 71e1a64 | 2014-05-05 21:44:13 +0000 | [diff] [blame^] | 1 | // RUN: rm -rf %t |
| 2 | // REQUIRES: shell |
| 3 | |
| 4 | // Including a header from the imported module |
| 5 | // RUN: echo '@import FromImportedModuleOK;' | \ |
| 6 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 7 | // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ |
| 8 | // RUN: -Werror -fsyntax-only -x objective-c - |
| 9 | |
| 10 | // Including a non-modular header |
| 11 | // RUN: echo '@import FromImportedModuleFail;' | \ |
| 12 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 13 | // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ |
| 14 | // RUN: -I %S/Inputs/require-modular-includes \ |
| 15 | // RUN: -fsyntax-only -x objective-c - 2>&1 | FileCheck %s |
| 16 | |
| 17 | // Including a header from a subframework |
| 18 | // RUN: echo '@import FromSubframework;' | \ |
| 19 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 20 | // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ |
| 21 | // RUN: -Werror -fsyntax-only -x objective-c - |
| 22 | |
| 23 | // Including a header from a subframework (fail) |
| 24 | // RUN: echo '@import FromNonModularSubframework;' | \ |
| 25 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 26 | // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ |
| 27 | // RUN: -I %S/Inputs/require-modular-includes \ |
| 28 | // RUN: -fsyntax-only -x objective-c - 2>&1 | FileCheck %s |
| 29 | |
| 30 | // Including a non-modular header from a submodule |
| 31 | // RUN: echo '@import FromImportedSubModule;' | \ |
| 32 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 33 | // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ |
| 34 | // RUN: -I %S/Inputs/require-modular-includes \ |
| 35 | // RUN: -fsyntax-only -x objective-c - 2>&1 | FileCheck %s |
| 36 | |
| 37 | // Including a non-modular header (directly) with -fmodule-name set |
| 38 | // RUN: echo '#include "NotInModule.h"' | \ |
| 39 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 40 | // RUN: -fmodules-cache-path=%t -I %S/Inputs/require-modular-includes \ |
| 41 | // RUN: -Werror -fmodule-name=A -fsyntax-only -x objective-c - |
| 42 | |
| 43 | // Including a non-modular header (directly) with -Wnon-modular-include |
| 44 | // RUN: echo '#include "NotInModule.h"' | \ |
| 45 | // RUN: %clang_cc1 -Wnon-modular-include -fmodules \ |
| 46 | // RUN: -fmodules-cache-path=%t -I %S/Inputs/require-modular-includes \ |
| 47 | // RUN: -fmodule-name=A -fsyntax-only -x objective-c - 2>&1 | FileCheck %s |
| 48 | |
| 49 | // Including an excluded header |
| 50 | // RUN: echo '@import IncludeExcluded;' | \ |
| 51 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 52 | // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ |
| 53 | // RUN: -Werror -fsyntax-only -x objective-c - |
| 54 | |
| 55 | // Including a header from another module |
| 56 | // RUN: echo '@import FromAnotherModule;' | \ |
| 57 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 58 | // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ |
| 59 | // RUN: -I %S/Inputs/require-modular-includes \ |
| 60 | // RUN: -Werror -fsyntax-only -x objective-c - |
| 61 | |
| 62 | // Including an excluded header from another module |
| 63 | // RUN: echo '@import ExcludedFromAnotherModule;' | \ |
| 64 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 65 | // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ |
| 66 | // RUN: -I %S/Inputs/require-modular-includes \ |
| 67 | // RUN: -Werror -fsyntax-only -x objective-c - |
| 68 | |
| 69 | // Including a header from an umbrella directory |
| 70 | // RUN: echo '@import FromUmbrella;' | \ |
| 71 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 72 | // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ |
| 73 | // RUN: -I %S/Inputs/require-modular-includes \ |
| 74 | // RUN: -Werror -fsyntax-only -x objective-c - |
| 75 | |
| 76 | // A includes B includes non-modular C |
| 77 | // RUN: echo '@import A;' | \ |
| 78 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 79 | // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ |
| 80 | // RUN: -I %S/Inputs/require-modular-includes \ |
| 81 | // RUN: -fsyntax-only -x objective-c - 2>&1 | FileCheck %s |
| 82 | |
| 83 | // Non-framework module (pass) |
| 84 | // RUN: echo '@import NotFramework;' | \ |
| 85 | // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ |
| 86 | // RUN: -fmodules-cache-path=%t -I %S/Inputs/require-modular-includes \ |
| 87 | // RUN: -Werror -fsyntax-only -x objective-c - |
| 88 | |
| 89 | // Non-framework module (fail) |
| 90 | // RUN: echo '@import NotFramework;' | \ |
| 91 | // RUN: not %clang_cc1 -Werror=non-modular-include -fmodules \ |
| 92 | // RUN: -fmodules-cache-path=%t -I %S/Inputs/require-modular-includes \ |
| 93 | // RUN: -fsyntax-only -x objective-c - 2>&1 | FileCheck %s |
| 94 | |
| 95 | // CHECK: include of non-modular header |