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 an excluded header 44 // RUN: echo '@import IncludeExcluded;' | \ 45 // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ 46 // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ 47 // RUN: -Werror -fsyntax-only -x objective-c - 48 49 // Including a header from another module 50 // RUN: echo '@import FromAnotherModule;' | \ 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: -I %S/Inputs/require-modular-includes \ 54 // RUN: -Werror -fsyntax-only -x objective-c - 55 56 // Including an excluded header from another module 57 // RUN: echo '@import ExcludedFromAnotherModule;' | \ 58 // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ 59 // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ 60 // RUN: -I %S/Inputs/require-modular-includes \ 61 // RUN: -Werror -fsyntax-only -x objective-c - 62 63 // Including a header from an umbrella directory 64 // RUN: echo '@import FromUmbrella;' | \ 65 // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ 66 // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ 67 // RUN: -I %S/Inputs/require-modular-includes \ 68 // RUN: -Werror -fsyntax-only -x objective-c - 69 70 // A includes B includes non-modular C 71 // RUN: echo '@import A;' | \ 72 // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ 73 // RUN: -fmodules-cache-path=%t -F %S/Inputs/require-modular-includes \ 74 // RUN: -I %S/Inputs/require-modular-includes \ 75 // RUN: -fsyntax-only -x objective-c - 2>&1 | FileCheck %s 76 77 // Non-framework module (pass) 78 // RUN: echo '@import NotFramework;' | \ 79 // RUN: %clang_cc1 -Wnon-modular-include-in-framework-module -fmodules \ 80 // RUN: -fmodules-cache-path=%t -I %S/Inputs/require-modular-includes \ 81 // RUN: -Werror -fsyntax-only -x objective-c - 82 83 // CHECK: include of non-modular header 84