1 // Clear and create directories
5 // RUN: mkdir %t/InputsA
7 // RUN: echo "module RequiresMacOS {" >> %t/InputsA/module.modulemap
8 // RUN: echo " requires macos" >> %t/InputsA/module.modulemap
9 // RUN: echo "}" >> %t/InputsA/module.modulemap
10 // RUN: echo "module RequiresNotiOS {" >> %t/InputsA/module.modulemap
11 // RUN: echo " requires !ios" >> %t/InputsA/module.modulemap
12 // RUN: echo "}" >> %t/InputsA/module.modulemap
13 // RUN: echo "module RequiresMain {" >> %t/InputsA/module.modulemap
14 // RUN: echo " module SubRequiresNotiOS {" >> %t/InputsA/module.modulemap
15 // RUN: echo " requires !ios" >> %t/InputsA/module.modulemap
16 // RUN: echo " }" >> %t/InputsA/module.modulemap
17 // RUN: echo "}" >> %t/InputsA/module.modulemap
19 // RUN: %clang_cc1 -triple=x86_64-apple-macosx10.6 -DENABLE_DARWIN -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsA -verify %s
20 // expected-no-diagnostics
22 // RUN: not %clang_cc1 -triple=arm64-apple-ios -DENABLE_DARWIN -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsA %s 2> %t/notios
23 // RUN: FileCheck %s -check-prefix=CHECK-IOS < %t/notios
25 // CHECK-IOS: module 'RequiresMacOS' requires feature 'macos'
26 @import RequiresMacOS;
27 // CHECK-IOS: module 'RequiresNotiOS' is incompatible with feature 'ios'
28 @import RequiresNotiOS;
29 // We should never get errors for submodules that don't match
30 // CHECK-IOS-NOT: module 'RequiresMain'
34 // RUN: mkdir %t/InputsB
35 // RUN: echo "module RequiresiOSSim {" >> %t/InputsB/module.modulemap
36 // RUN: echo " requires iossimulator" >> %t/InputsB/module.modulemap
37 // RUN: echo "}" >> %t/InputsB/module.modulemap
38 // RUN: %clang_cc1 -triple=x86_64-apple-iossimulator -DENABLE_IOSSIM -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsB %s -verify
39 // RUN: %clang_cc1 -triple=x86_64-apple-ios-simulator -DENABLE_IOSSIM -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsB %s -verify
42 @import RequiresiOSSim;
45 // RUN: mkdir %t/InputsC
46 // RUN: echo "module RequiresLinuxEABIA {" >> %t/InputsC/module.modulemap
47 // RUN: echo " requires linux, gnueabi" >> %t/InputsC/module.modulemap
48 // RUN: echo "}" >> %t/InputsC/module.modulemap
49 // RUN: echo "module RequiresLinuxEABIB {" >> %t/InputsC/module.modulemap
50 // RUN: echo " requires gnueabi" >> %t/InputsC/module.modulemap
51 // RUN: echo "}" >> %t/InputsC/module.modulemap
52 // RUN: echo "module RequiresLinuxEABIC {" >> %t/InputsC/module.modulemap
53 // RUN: echo " requires linux" >> %t/InputsC/module.modulemap
54 // RUN: echo "}" >> %t/InputsC/module.modulemap
55 // RUN: %clang_cc1 -triple=armv8r-none-linux-gnueabi -DENABLE_LINUXEABI -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsC %s -verify
57 #ifdef ENABLE_LINUXEABI
58 @import RequiresLinuxEABIA;
59 @import RequiresLinuxEABIB;
60 @import RequiresLinuxEABIC;
63 // RUN: mkdir %t/InputsD
64 // RUN: echo "module RequiresWinMSVCA {" >> %t/InputsD/module.modulemap
65 // RUN: echo " requires windows" >> %t/InputsD/module.modulemap
66 // RUN: echo "}" >> %t/InputsD/module.modulemap
67 // RUN: echo "module RequiresWinMSVCB {" >> %t/InputsD/module.modulemap
68 // RUN: echo " requires windows, msvc" >> %t/InputsD/module.modulemap
69 // RUN: echo "}" >> %t/InputsD/module.modulemap
70 // RUN: echo "module RequiresWinMSVCC {" >> %t/InputsD/module.modulemap
71 // RUN: echo " requires msvc" >> %t/InputsD/module.modulemap
72 // RUN: echo "}" >> %t/InputsD/module.modulemap
73 // RUN: %clang_cc1 -triple=thumbv7-unknown-windows-msvc -DENABLE_WINMSVC -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -x objective-c -I%t/InputsD %s -verify
76 @import RequiresWinMSVCA;
77 @import RequiresWinMSVCB;
78 @import RequiresWinMSVCC;