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/Mismatch.yaml -o %t/System/Library/Frameworks/MismatchCpp.framework/MismatchCpp
7 // RUN: not clang-installapi --target=arm64-apple-macos13 -x objective-c++ \
8 // RUN: -F %t/System/Library/Frameworks \
9 // RUN: -install_name /System/Library/Frameworks/MismatchCpp.framework/Versions/A/MismatchCpp \
10 // RUN: -current_version 1 -compatibility_version 1 %t/inputs.json \
11 // RUN: --verify-against=%t/System/Library/Frameworks/MismatchCpp.framework/MismatchCpp \
12 // RUN: --verify-mode=Pedantic -o %t/output.tbd --demangle 2> %t/errors.log
13 // RUN: FileCheck -input-file %t/errors.log %s
15 CHECK: warning: violations found for arm64-apple-macos13
16 CHECK: CPP.h:5:7: error: declaration has external linkage, but symbol has internal linkage in dynamic library 'vtable for Bar'
17 CHECK-NEXT: class Bar : Foo {
19 CHECK-NEXT: CPP.h:5:7: error: declaration has external linkage, but symbol has internal linkage in dynamic library 'typeinfo for Bar'
20 CHECK-NEXT: CPP.h:5:7: error: declaration has external linkage, but symbol has internal linkage in dynamic library 'typeinfo name for Bar'
21 CHECK-NEXT: CPP.h:6:7: error: dynamic library symbol '(weak-def) Bar::init()' is weak defined, but its declaration is not
22 CHECK-NEXT: int init();
24 CHECK-NEXT: warning: violations found for arm64
25 CHECK-NEXT: error: no declaration found for exported symbol 'int foo<unsigned int>(unsigned int)' in dynamic library
30 "path" : "DSTROOT/System/Library/Frameworks/MismatchCpp.framework/Headers/CPP.h",
37 //--- System/Library/Frameworks/MismatchCpp.framework/Headers/CPP.h
39 virtual int init() = 0;
47 // With LD flags: -exported_symbol,"__ZN3Bar4initEv" -exported_symbol,"__Z3fooIjEiT_"
48 // class Foo { virtual int init() = 0;};
50 // class Bar : Foo {int init() { return 1;}};
53 // template <typename T> int foo(T val) { return 1; }
54 // template <> int foo(unsigned val) { return 1; }
92 content: 20008052C0035FD620008052C0035FD6
105 content: 334261720033466F6F00
106 - sectname: __unwind_info
118 content: 010000001C000000010000002000000000000000200000000200000000000002E81000003800000038000000F81000000000000038000000030000000C0001001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
121 segname: __DATA_CONST
132 segname: __DATA_CONST
143 content: 00000000000000002840000000000000F0100000000000001000000000000000FD100000000000801000000000000000F810000000000080000000000100000018400000000000000000000000000000
144 - sectname: __objc_imageinfo
145 segname: __DATA_CONST
156 content: '0000000040000000'
181 content: '1040000000000000'
193 - cmd: LC_DYLD_INFO_ONLY
236 current_version: 65536
237 compatibility_version: 65536
238 Content: '/System/Library/Frameworks/MismatchCpp.framework/Versions/A/MismatchCpp'
242 uuid: 4C4C44F3-5555-3144-A13F-B3FE15787197
243 - cmd: LC_BUILD_VERSION
257 current_version: 117985024
258 compatibility_version: 65536
259 Content: '/usr/lib/libc++.1.dylib'
266 current_version: 88473600
267 compatibility_version: 65536
268 Content: '/usr/lib/libSystem.B.dylib'
270 - cmd: LC_FUNCTION_STARTS
274 - cmd: LC_DATA_IN_CODE
278 - cmd: LC_CODE_SIGNATURE
284 - Opcode: REBASE_OPCODE_SET_TYPE_IMM
286 - Opcode: REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
289 - Opcode: REBASE_OPCODE_DO_REBASE_IMM_TIMES
291 - Opcode: REBASE_OPCODE_ADD_ADDR_IMM_SCALED
293 - Opcode: REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB
295 ExtraData: [ 0x3, 0x8 ]
296 - Opcode: REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
299 - Opcode: REBASE_OPCODE_DO_REBASE_IMM_TIMES
301 - Opcode: REBASE_OPCODE_DONE
304 - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
306 Symbol: __ZTVN10__cxxabiv117__class_type_infoE
307 - Opcode: BIND_OPCODE_SET_TYPE_IMM
310 - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
313 - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
315 ULEBExtraData: [ 0x18 ]
317 - Opcode: BIND_OPCODE_SET_ADDEND_SLEB
319 SLEBExtraData: [ 16 ]
321 - Opcode: BIND_OPCODE_DO_BIND
324 - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
326 Symbol: __ZTVN10__cxxabiv121__vmi_class_type_infoE
327 - Opcode: BIND_OPCODE_SET_TYPE_IMM
330 - Opcode: BIND_OPCODE_ADD_ADDR_ULEB
332 ULEBExtraData: [ 0x8 ]
334 - Opcode: BIND_OPCODE_DO_BIND
337 - Opcode: BIND_OPCODE_DONE
341 - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
343 Symbol: __ZN3Bar4initEv
344 - Opcode: BIND_OPCODE_SET_TYPE_IMM
347 - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
349 ULEBExtraData: [ 0x10 ]
351 - Opcode: BIND_OPCODE_DO_BIND
354 - Opcode: BIND_OPCODE_DONE
454 - __ZTVN10__cxxabiv117__class_type_infoE
455 - __ZTVN10__cxxabiv121__vmi_class_type_infoE
463 FunctionStarts: [ 0x10E8, 0x10F0 ]