1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
|
; RUN: rm -rf %t
; RUN: split-file %s %t
; RUN: sed -e "s|DSTROOT|%/t|g" %t/inputs.json.in > %t/inputs.json
; RUN: yaml2obj %t/Xplatform.yaml -o=%t/Xplatform
// Check that in zippered mode, a successful pass runs in both macos & maccatalyst.
; RUN: clang-installapi %t/inputs.json \
; RUN: --target=x86_64-apple-macos10.15 -darwin-target-variant x86_64-apple-ios13.1-macabi \
; RUN: -Xplatform_ios-macabi -iframework %t/System/iOSSupport/System/Library/Frameworks \
; RUN: -install_name /System/Library/Frameworks/Xplatform.framework/Versions/A/Xplatform \
; RUN: -fdefine-target-os-macros --verify-against=%t/Xplatform --verify-mode=Pedantic \
; RUN: -o Xplatform.tbd -F%t/Frameworks \
: RUN: -current_version 1 -compatibility_version 1 2>&1 | FileCheck --allow-empty %s\
; RUN: --implicit-check-not warning: --implicit-check-not error:
// A missing header error should be invoked in macos pass because it wasn't given the needed search path.
; RUN: mv %t/Xplatform-macosx.h %t/Frameworks/Xplatform.framework/Headers/Xplatform.h
; RUN: not clang-installapi %t/inputs.json \
; RUN: --target=x86_64-apple-macos10.15 -darwin-target-variant x86_64-apple-ios13.1-macabi \
; RUN: -Xplatform_ios-macabi -iframework %t/System/iOSSupport/System/Library/Frameworks \
; RUN: -install_name /System/Library/Frameworks/Xplatform.framework/Versions/A/Xplatform \
; RUN: -fdefine-target-os-macros --verify-against=%t/Xplatform --verify-mode=Pedantic \
; RUN: -o Xplatform.tbd -F%t/Frameworks \
: RUN: -current_version 1 -compatibility_version 1 2>&1 | FileCheck -check-prefix=MACOSFAIL %s
; MACOSFAIL: fatal error: 'IOSMac/IOSMac.h' file not found
;--- Frameworks/Xplatform.framework/Headers/Xplatform.h
#if TARGET_OS_MACCATALYST
#include <IOSMac/IOSMac.h>
#endif
inline int foo() {
int x = 1;
#if TARGET_OS_MACCATALYST
x += iOSAPI();
#endif
return x;
}
extern int bar();
;--- Xplatform-macosx.h
#include <IOSMac/IOSMac.h>
inline int foo() {
int x = 1;
return x;
}
extern int bar();
;--- System/iOSSupport/System/Library/Frameworks/IOSMac.framework/Headers/IOSMac.h
extern int iOSAPI();
;--- Xplatform.yaml
--- !mach-o
FileHeader:
magic: 0xFEEDFACF
cputype: 0x1000007
cpusubtype: 0x3
filetype: 0x6
ncmds: 16
sizeofcmds: 968
flags: 0x100085
reserved: 0x0
LoadCommands:
- cmd: LC_SEGMENT_64
cmdsize: 232
segname: __TEXT
vmaddr: 0
vmsize: 32768
fileoff: 0
filesize: 32768
maxprot: 5
initprot: 5
nsects: 2
flags: 0
Sections:
- sectname: __text
segname: __TEXT
addr: 0x4FAD
size: 11
offset: 0x4FAD
align: 0
reloff: 0x0
nreloc: 0
flags: 0x80000400
reserved1: 0x0
reserved2: 0x0
reserved3: 0x0
content: 554889E5B8010000005DC3
- sectname: __unwind_info
segname: __TEXT
addr: 0x4FB8
size: 72
offset: 0x4FB8
align: 2
reloff: 0x0
nreloc: 0
flags: 0x0
reserved1: 0x0
reserved2: 0x0
reserved3: 0x0
content: 010000001C000000000000001C000000000000001C00000002000000AD4F00003400000034000000B94F00000000000034000000030000000C000100100001000000000000000001
- cmd: LC_SEGMENT_64
cmdsize: 152
segname: __DATA
vmaddr: 32768
vmsize: 16384
fileoff: 32768
filesize: 16384
maxprot: 3
initprot: 3
nsects: 1
flags: 0
Sections:
- sectname: __objc_imageinfo
segname: __DATA
addr: 0x8000
size: 8
offset: 0x8000
align: 2
reloff: 0x0
nreloc: 0
flags: 0x0
reserved1: 0x0
reserved2: 0x0
reserved3: 0x0
content: '0000000040000000'
- cmd: LC_SEGMENT_64
cmdsize: 72
segname: __LINKEDIT
vmaddr: 49152
vmsize: 16384
fileoff: 49152
filesize: 88
maxprot: 1
initprot: 1
nsects: 0
flags: 0
- cmd: LC_ID_DYLIB
cmdsize: 96
dylib:
name: 24
timestamp: 1
current_version: 65536
compatibility_version: 65536
Content: '/System/Library/Frameworks/Xplatform.framework/Versions/A/Xplatform'
ZeroPadBytes: 5
- cmd: LC_DYLD_INFO_ONLY
cmdsize: 48
rebase_off: 0
rebase_size: 0
bind_off: 0
bind_size: 0
weak_bind_off: 0
weak_bind_size: 0
lazy_bind_off: 0
lazy_bind_size: 0
export_off: 49152
export_size: 16
- cmd: LC_SYMTAB
cmdsize: 24
symoff: 49184
nsyms: 2
stroff: 49216
strsize: 24
- cmd: LC_DYSYMTAB
cmdsize: 80
ilocalsym: 0
nlocalsym: 0
iextdefsym: 0
nextdefsym: 1
iundefsym: 1
nundefsym: 1
tocoff: 0
ntoc: 0
modtaboff: 0
nmodtab: 0
extrefsymoff: 0
nextrefsyms: 0
indirectsymoff: 0
nindirectsyms: 0
extreloff: 0
nextrel: 0
locreloff: 0
nlocrel: 0
- cmd: LC_UUID
cmdsize: 24
uuid: 4AA4F126-BD02-359C-B3EF-E53AD399B590
- cmd: LC_BUILD_VERSION
cmdsize: 32
platform: 1
minos: 659200
sdk: 721152
ntools: 1
Tools:
- tool: 3
version: 46008832
- cmd: LC_BUILD_VERSION
cmdsize: 32
platform: 6
minos: 0x00d0100
sdk: 851968
ntools: 1
Tools:
- tool: 3
version: 46008832
- cmd: LC_SOURCE_VERSION
cmdsize: 16
version: 0
- cmd: LC_SEGMENT_SPLIT_INFO
cmdsize: 16
dataoff: 49168
datasize: 8
- cmd: LC_LOAD_DYLIB
cmdsize: 56
dylib:
name: 24
timestamp: 2
current_version: 14942208
compatibility_version: 65536
Content: '/usr/lib/libobjc.A.dylib'
ZeroPadBytes: 8
- cmd: LC_LOAD_DYLIB
cmdsize: 56
dylib:
name: 24
timestamp: 2
current_version: 84687873
compatibility_version: 65536
Content: '/usr/lib/libSystem.B.dylib'
ZeroPadBytes: 6
- cmd: LC_FUNCTION_STARTS
cmdsize: 16
dataoff: 49176
datasize: 8
- cmd: LC_DATA_IN_CODE
cmdsize: 16
dataoff: 49184
datasize: 0
LinkEditData:
ExportTrie:
TerminalSize: 0
NodeOffset: 0
Name: ''
Flags: 0x0
Address: 0x0
Other: 0x0
ImportName: ''
Children:
- TerminalSize: 4
NodeOffset: 8
Name: _bar
Flags: 0x0
Address: 0x4FAD
Other: 0x0
ImportName: ''
NameList:
- n_strx: 2
n_type: 0xF
n_sect: 1
n_desc: 0
n_value: 20397
- n_strx: 7
n_type: 0x1
n_sect: 0
n_desc: 512
n_value: 0
StringTable:
- ' '
- _bar
- dyld_stub_binder
...
;--- inputs.json.in
{
"headers": [
{
"path" : "DSTROOT/Frameworks/Xplatform.framework/Headers/Xplatform.h",
"type" : "public"
}
],
"version": "3"
}
|