287 lines · plain
1; RUN: rm -rf %t2; RUN: split-file %s %t3; RUN: sed -e "s|DSTROOT|%/t|g" %t/inputs.json.in > %t/inputs.json4; RUN: yaml2obj %t/Xplatform.yaml -o=%t/Xplatform5 6// Check that in zippered mode, a successful pass runs in both macos & maccatalyst.7; RUN: clang-installapi %t/inputs.json \8; RUN: --target=x86_64-apple-macos10.15 -darwin-target-variant x86_64-apple-ios13.1-macabi \9; RUN: -Xplatform_ios-macabi -iframework %t/System/iOSSupport/System/Library/Frameworks \10; RUN: -install_name /System/Library/Frameworks/Xplatform.framework/Versions/A/Xplatform \11; RUN: -fdefine-target-os-macros --verify-against=%t/Xplatform --verify-mode=Pedantic \12; RUN: -o Xplatform.tbd -F%t/Frameworks \13: RUN: -current_version 1 -compatibility_version 1 2>&1 | FileCheck --allow-empty %s\14; RUN: --implicit-check-not warning: --implicit-check-not error:15 16// A missing header error should be invoked in macos pass because it wasn't given the needed search path.17; RUN: mv %t/Xplatform-macosx.h %t/Frameworks/Xplatform.framework/Headers/Xplatform.h18 19; RUN: not clang-installapi %t/inputs.json \20; RUN: --target=x86_64-apple-macos10.15 -darwin-target-variant x86_64-apple-ios13.1-macabi \21; RUN: -Xplatform_ios-macabi -iframework %t/System/iOSSupport/System/Library/Frameworks \22; RUN: -install_name /System/Library/Frameworks/Xplatform.framework/Versions/A/Xplatform \23; RUN: -fdefine-target-os-macros --verify-against=%t/Xplatform --verify-mode=Pedantic \24; RUN: -o Xplatform.tbd -F%t/Frameworks \25: RUN: -current_version 1 -compatibility_version 1 2>&1 | FileCheck -check-prefix=MACOSFAIL %s 26 27; MACOSFAIL: fatal error: 'IOSMac/IOSMac.h' file not found28 29;--- Frameworks/Xplatform.framework/Headers/Xplatform.h30#if TARGET_OS_MACCATALYST31#include <IOSMac/IOSMac.h>32#endif33 34inline int foo() {35 int x = 1;36#if TARGET_OS_MACCATALYST37 x += iOSAPI();38#endif39 return x;40}41 42extern int bar();43 44;--- Xplatform-macosx.h45#include <IOSMac/IOSMac.h>46inline int foo() {47 int x = 1;48 return x;49}50 51extern int bar();52 53;--- System/iOSSupport/System/Library/Frameworks/IOSMac.framework/Headers/IOSMac.h54extern int iOSAPI();55 56;--- Xplatform.yaml57--- !mach-o58FileHeader:59 magic: 0xFEEDFACF60 cputype: 0x100000761 cpusubtype: 0x362 filetype: 0x663 ncmds: 1664 sizeofcmds: 96865 flags: 0x10008566 reserved: 0x067LoadCommands:68 - cmd: LC_SEGMENT_6469 cmdsize: 23270 segname: __TEXT71 vmaddr: 072 vmsize: 3276873 fileoff: 074 filesize: 3276875 maxprot: 576 initprot: 577 nsects: 278 flags: 079 Sections:80 - sectname: __text81 segname: __TEXT82 addr: 0x4FAD83 size: 1184 offset: 0x4FAD85 align: 086 reloff: 0x087 nreloc: 088 flags: 0x8000040089 reserved1: 0x090 reserved2: 0x091 reserved3: 0x092 content: 554889E5B8010000005DC393 - sectname: __unwind_info94 segname: __TEXT95 addr: 0x4FB896 size: 7297 offset: 0x4FB898 align: 299 reloff: 0x0100 nreloc: 0101 flags: 0x0102 reserved1: 0x0103 reserved2: 0x0104 reserved3: 0x0105 content: 010000001C000000000000001C000000000000001C00000002000000AD4F00003400000034000000B94F00000000000034000000030000000C000100100001000000000000000001106 - cmd: LC_SEGMENT_64107 cmdsize: 152108 segname: __DATA109 vmaddr: 32768110 vmsize: 16384111 fileoff: 32768112 filesize: 16384113 maxprot: 3114 initprot: 3115 nsects: 1116 flags: 0117 Sections:118 - sectname: __objc_imageinfo119 segname: __DATA120 addr: 0x8000121 size: 8122 offset: 0x8000123 align: 2124 reloff: 0x0125 nreloc: 0126 flags: 0x0127 reserved1: 0x0128 reserved2: 0x0129 reserved3: 0x0130 content: '0000000040000000'131 - cmd: LC_SEGMENT_64132 cmdsize: 72133 segname: __LINKEDIT134 vmaddr: 49152135 vmsize: 16384136 fileoff: 49152137 filesize: 88138 maxprot: 1139 initprot: 1140 nsects: 0141 flags: 0142 - cmd: LC_ID_DYLIB143 cmdsize: 96144 dylib:145 name: 24146 timestamp: 1147 current_version: 65536148 compatibility_version: 65536149 Content: '/System/Library/Frameworks/Xplatform.framework/Versions/A/Xplatform'150 ZeroPadBytes: 5151 - cmd: LC_DYLD_INFO_ONLY152 cmdsize: 48153 rebase_off: 0154 rebase_size: 0155 bind_off: 0156 bind_size: 0157 weak_bind_off: 0158 weak_bind_size: 0159 lazy_bind_off: 0160 lazy_bind_size: 0161 export_off: 49152162 export_size: 16163 - cmd: LC_SYMTAB164 cmdsize: 24165 symoff: 49184166 nsyms: 2167 stroff: 49216168 strsize: 24169 - cmd: LC_DYSYMTAB170 cmdsize: 80171 ilocalsym: 0172 nlocalsym: 0173 iextdefsym: 0174 nextdefsym: 1175 iundefsym: 1176 nundefsym: 1177 tocoff: 0178 ntoc: 0179 modtaboff: 0180 nmodtab: 0181 extrefsymoff: 0182 nextrefsyms: 0183 indirectsymoff: 0184 nindirectsyms: 0185 extreloff: 0186 nextrel: 0187 locreloff: 0188 nlocrel: 0189 - cmd: LC_UUID190 cmdsize: 24191 uuid: 4AA4F126-BD02-359C-B3EF-E53AD399B590192 - cmd: LC_BUILD_VERSION193 cmdsize: 32194 platform: 1195 minos: 659200196 sdk: 721152197 ntools: 1198 Tools:199 - tool: 3200 version: 46008832201 - cmd: LC_BUILD_VERSION202 cmdsize: 32203 platform: 6204 minos: 0x00d0100 205 sdk: 851968206 ntools: 1207 Tools:208 - tool: 3209 version: 46008832210 - cmd: LC_SOURCE_VERSION211 cmdsize: 16212 version: 0213 - cmd: LC_SEGMENT_SPLIT_INFO214 cmdsize: 16215 dataoff: 49168216 datasize: 8217 - cmd: LC_LOAD_DYLIB218 cmdsize: 56219 dylib:220 name: 24221 timestamp: 2222 current_version: 14942208223 compatibility_version: 65536224 Content: '/usr/lib/libobjc.A.dylib'225 ZeroPadBytes: 8226 - cmd: LC_LOAD_DYLIB227 cmdsize: 56228 dylib:229 name: 24230 timestamp: 2231 current_version: 84687873232 compatibility_version: 65536233 Content: '/usr/lib/libSystem.B.dylib'234 ZeroPadBytes: 6235 - cmd: LC_FUNCTION_STARTS236 cmdsize: 16237 dataoff: 49176238 datasize: 8239 - cmd: LC_DATA_IN_CODE240 cmdsize: 16241 dataoff: 49184242 datasize: 0243LinkEditData:244 ExportTrie:245 TerminalSize: 0246 NodeOffset: 0247 Name: ''248 Flags: 0x0249 Address: 0x0250 Other: 0x0251 ImportName: ''252 Children:253 - TerminalSize: 4254 NodeOffset: 8255 Name: _bar256 Flags: 0x0257 Address: 0x4FAD258 Other: 0x0259 ImportName: ''260 NameList:261 - n_strx: 2262 n_type: 0xF263 n_sect: 1264 n_desc: 0265 n_value: 20397266 - n_strx: 7267 n_type: 0x1268 n_sect: 0269 n_desc: 512270 n_value: 0271 StringTable:272 - ' '273 - _bar274 - dyld_stub_binder275...276 277;--- inputs.json.in278{279 "headers": [ 280 {281 "path" : "DSTROOT/Frameworks/Xplatform.framework/Headers/Xplatform.h",282 "type" : "public"283 }284 ],285 "version": "3"286}287