1 // Clear and create directories
5 // RUN: mkdir %t/InputsA
7 // RUN: echo "module RequiresMacOS {" >> %t/InputsA/module.map
8 // RUN: echo " requires macos" >> %t/InputsA/module.map
9 // RUN: echo "}" >> %t/InputsA/module.map
10 // RUN: echo "module RequiresNotiOS {" >> %t/InputsA/module.map
11 // RUN: echo " requires !ios" >> %t/InputsA/module.map
12 // RUN: echo "}" >> %t/InputsA/module.map
13 // RUN: echo "module RequiresMain {" >> %t/InputsA/module.map
14 // RUN: echo " module SubRequiresNotiOS {" >> %t/InputsA/module.map
15 // RUN: echo " requires !ios" >> %t/InputsA/module.map
16 // RUN: echo " }" >> %t/InputsA/module.map
17 // RUN: echo "}" >> %t/InputsA/module.map
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.map
36 // RUN: echo " requires iossimulator" >> %t/InputsB/module.map
37 // RUN: echo "}" >> %t/InputsB/module.map
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.map
47 // RUN: echo " requires linux, gnueabi" >> %t/InputsC/module.map
48 // RUN: echo "}" >> %t/InputsC/module.map
49 // RUN: echo "module RequiresLinuxEABIB {" >> %t/InputsC/module.map
50 // RUN: echo " requires gnueabi" >> %t/InputsC/module.map
51 // RUN: echo "}" >> %t/InputsC/module.map
52 // RUN: echo "module RequiresLinuxEABIC {" >> %t/InputsC/module.map
53 // RUN: echo " requires linux" >> %t/InputsC/module.map
54 // RUN: echo "}" >> %t/InputsC/module.map
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.map
65 // RUN: echo " requires windows" >> %t/InputsD/module.map
66 // RUN: echo "}" >> %t/InputsD/module.map
67 // RUN: echo "module RequiresWinMSVCB {" >> %t/InputsD/module.map
68 // RUN: echo " requires windows, msvc" >> %t/InputsD/module.map
69 // RUN: echo "}" >> %t/InputsD/module.map
70 // RUN: echo "module RequiresWinMSVCC {" >> %t/InputsD/module.map
71 // RUN: echo " requires msvc" >> %t/InputsD/module.map
72 // RUN: echo "}" >> %t/InputsD/module.map
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;