2 ; RUN: split-file %s %t
3 ; RUN: sed -e "s|DSTROOT|%/t|g" %t/inputs.json.in > %t/inputs.json
5 ; RUN: yaml2obj %t/Umbrella.yaml -o %t/Umbrella
6 ; RUN: mkdir -p %t/System/Library/Frameworks/Bar.framework
7 ; RUN: yaml2obj %t/Bar.yaml -o %t/System/Library/Frameworks/Bar.framework/Bar
9 ; RUN: clang-installapi -target x86_64-apple-macosx13 -install_name \
10 ; RUN: /System/Library/Frameworks/Umbrella3.framework/Versions/A/Umbrella3 \
11 ; RUN: -current_version 1 -compatibility_version 1 \
12 ; RUN: --verify-against=%t/Umbrella \
13 ; RUN: -F %t/System/Library/Frameworks -L %t/usr/lib \
14 ; RUN: %t/inputs.json --verify-mode=Pedantic \
15 ; RUN: -reexport_framework Foo -reexport_framework Bar -reexport-lBaz \
16 ; RUN: -o %t/Umbrella.tbd 2>&1 | FileCheck -allow-empty %s
17 ; RUN: llvm-readtapi -compare %t/Umbrella.tbd %t/expected.tbd 2>&1 | FileCheck -allow-empty %s
19 // Checks that one of the reexported frameworks found earlier doesn't resolve
20 // a missing export from a declaration.
21 ; RUN: not clang-installapi -target x86_64-apple-macosx13 -install_name \
22 ; RUN: /System/Library/Frameworks/Umbrella3.framework/Versions/A/Umbrella3 \
23 ; RUN: -current_version 1 -compatibility_version 1 \
24 ; RUN: --verify-against=%t/Umbrella \
25 ; RUN: %t/inputs.json -F %t/BadFoo \
26 ; RUN: -F %t/System/Library/Frameworks -L %t/usr/lib \
27 ; RUN: --verify-mode=ErrorsOnly \
28 ; RUN: -reexport_framework Foo -reexport_framework Bar -reexport-lBaz \
29 ; RUN: -o %t/Umbrella.tbd 2>&1 | FileCheck %s --check-prefix MISSING_SYMBOL
31 ; MISSING_SYMBOL: error: declaration has external linkage, but dynamic library doesn't have symbol 'foo'
32 ; MISSING_SYMBOL-NEXT: extern int foo();
38 ;--- System/Library/Frameworks/Umbrella.framework/Headers/Bar.h
41 ;--- System/Library/Frameworks/Umbrella.framework/Headers/Baz.h
44 ;--- System/Library/Frameworks/Umbrella.framework/Headers/Foo.h
47 ;--- System/Library/Frameworks/Umbrella.framework/Headers/Umbrella.h
48 #import <Umbrella/Bar.h>
49 #import <Umbrella/Baz.h>
50 #import <Umbrella/Foo.h>
55 "path" : "DSTROOT/System/Library/Frameworks/Umbrella.framework/Headers/Bar.h",
59 "path" : "DSTROOT/System/Library/Frameworks/Umbrella.framework/Headers/Baz.h",
63 "path" : "DSTROOT/System/Library/Frameworks/Umbrella.framework/Headers/Umbrella.h",
67 "path" : "DSTROOT/System/Library/Frameworks/Umbrella.framework/Headers/Foo.h",
113 segname: __DATA_CONST
123 - sectname: __objc_imageinfo
124 segname: __DATA_CONST
135 content: '0000000040000000'
147 - cmd: LC_DYLD_INFO_ONLY
190 current_version: 65536
191 compatibility_version: 65536
192 Content: '/System/Library/Frameworks/Umbrella3.framework/Versions/A/Umbrella3'
196 uuid: 4C4C44AE-5555-3144-A1D3-33A5C6F7B36A
197 - cmd: LC_BUILD_VERSION
211 current_version: 65536
212 compatibility_version: 65536
213 Content: '/System/Library/Frameworks/Foo.framework/Versions/A/Foo'
215 - cmd: LC_REEXPORT_DYLIB
221 compatibility_version: 0
222 Content: '/System/Library/Frameworks/Foo.framework/Versions/A/Foo'
229 current_version: 65536
230 compatibility_version: 65536
231 Content: '/System/Library/Frameworks/Bar.framework/Versions/A/Bar'
233 - cmd: LC_REEXPORT_DYLIB
239 compatibility_version: 0
240 Content: '/System/Library/Frameworks/Bar.framework/Versions/A/Bar'
247 current_version: 65536
248 compatibility_version: 65536
249 Content: '/usr/lib/libBaz.1.dylib'
251 - cmd: LC_REEXPORT_DYLIB
257 compatibility_version: 0
258 Content: '/usr/lib/libBaz.1.dylib'
265 current_version: 88539136
266 compatibility_version: 65536
267 Content: '/usr/lib/libSystem.B.dylib'
269 - cmd: LC_FUNCTION_STARTS
273 - cmd: LC_DATA_IN_CODE
294 ;--- System/Library/Frameworks/Foo.framework/Foo.tbd
297 "exported_symbols": [
309 "not_app_extension_safe"
315 "name": "/System/Library/Frameworks/Foo.framework/Versions/A/Foo"
320 "min_deployment": "13",
321 "target": "x86_64-macos"
325 "tapi_tbd_version": 5
364 content: 554889E531C05DC3
365 - sectname: __unwind_info
377 content: 010000001C000000010000002000000000000000200000000200000000000001B00B00003800000038000000B80B00000000000038000000030000000C0001001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
378 - sectname: __eh_frame
390 content: 1400000000000000017A520001781001100C070890010000
393 segname: __DATA_CONST
403 - sectname: __objc_imageinfo
404 segname: __DATA_CONST
415 content: '0000000040000000'
427 - cmd: LC_DYLD_INFO_ONLY
470 current_version: 65536
471 compatibility_version: 65536
472 Content: '/System/Library/Frameworks/Bar.framework/Versions/A/Bar'
476 uuid: 4C4C4415-5555-3144-A11E-3C68D85CC061
477 - cmd: LC_BUILD_VERSION
491 current_version: 88539136
492 compatibility_version: 65536
493 Content: '/usr/lib/libSystem.B.dylib'
495 - cmd: LC_FUNCTION_STARTS
499 - cmd: LC_DATA_IN_CODE
535 FunctionStarts: [ 0xBB0 ]
538 ;--- usr/lib/libBaz.tbd
541 "exported_symbols": [
553 "not_app_extension_safe"
559 "name": "/usr/lib/libBaz.1.dylib"
564 "min_deployment": "13",
565 "target": "x86_64-macos"
569 "tapi_tbd_version": 5
572 ;--- BadFoo/Foo.framework/Foo.tbd
575 "exported_symbols": [
587 "not_app_extension_safe"
593 "name": "/System/Library/Frameworks/Foo.framework/Versions/A/Foo"
598 "min_deployment": "13",
599 "target": "x86_64-macos"
603 "tapi_tbd_version": 5
612 "not_app_extension_safe"
618 "name": "/System/Library/Frameworks/Umbrella3.framework/Versions/A/Umbrella3"
621 "reexported_libraries": [
624 "/System/Library/Frameworks/Bar.framework/Versions/A/Bar",
625 "/System/Library/Frameworks/Foo.framework/Versions/A/Foo",
626 "/usr/lib/libBaz.1.dylib"
632 "min_deployment": "13",
633 "target": "x86_64-macos"
637 "tapi_tbd_version": 5