<commit_before># Check we accept -install_name correctly:
# RUN: lld -flavor darwin -arch x86_64 -install_name libwibble.dylib -dylib %s -o %t.dylib
# RUN: macho-dump %t.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE

# Check we read LC_ID_DYLIB correctly:
# RUN: lld -flavor darwin -arch x86_64 %p/Inputs/use-dylib-install-names.yaml %t.dylib -r -print_atoms | FileCheck %s --check-prefix=CHECK-BINARY-READ

# Check we default the install-name to the output file:
# RUN: lld -flavor darwin -arch x86_64 -dylib %s -o libwibble.dylib
# RUN: macho-dump libwibble.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE
# RUN: rm -f libwibble.dylib

# Check the default output file is a.out, and this also goes into LC_ID_DYLIB.
# RUN: lld -flavor darwin -arch x86_64 -dylib %s
# RUN: macho-dump a.out | FileCheck %s --check-prefix=CHECK-BINARY-WRITE-AOUT
# RUN: rm -f a.out

--- !mach-o
arch:            x86_64
file-type:       MH_OBJECT
flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
has-UUID:        false
OS:              unknown
sections:
  - segment:         __TEXT
    section:         __text
    type:            S_REGULAR
    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
    alignment:       4
    address:         0x0000000000000000
    content:         [ 0xCC, 0xC3, 0x90, 0xC3, 0x90, 0x90, 0xC3, 0x90,
                       0x90, 0x90, 0xC3, 0x90, 0x90, 0x90, 0x90, 0xC3,
                       0x31, 0xC0, 0xC3 ]
local-symbols:
  - name:            _myStatic
    type:            N_SECT
    sect:            1
    value:           0x000000000000000B
global-symbols:
  - name:            _myGlobal
    type:            N_SECT
    scope:           [ N_EXT ]
    sect:            1
    value:           0x0000000000000001
...


# CHECK-BINARY-WRITE: (('command', 13)
# CHECK-BINARY-WRITE-NEXT:  ('size', 40)
# CHECK-BINARY-WRITE-NEXT:  ('install_name', 'libwibble.dylib')

# CHECK-BINARY-WRITE-AOUT: (('command', 13)
# CHECK-BINARY-WRITE-AOUT-NEXT:  ('size', 32)
# CHECK-BINARY-WRITE-AOUT-NEXT:  ('install_name', 'a.out')

# CHECK-BINARY-READ: shared-library-atoms:
# CHECK-BINARY-READ:     - name:          _myGlobal
# CHECK-BINARY-READ:       load-name:     libwibble.dylib<commit_msg>[mach-o]: remove dylib install-name test with a.out<commit_after># Check we accept -install_name correctly:
# RUN: lld -flavor darwin -arch x86_64 -install_name libwibble.dylib -dylib %s -o %t.dylib
# RUN: macho-dump %t.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE

# Check we read LC_ID_DYLIB correctly:
# RUN: lld -flavor darwin -arch x86_64 %p/Inputs/use-dylib-install-names.yaml %t.dylib -r -print_atoms | FileCheck %s --check-prefix=CHECK-BINARY-READ

# Check we default the install-name to the output file:
# RUN: lld -flavor darwin -arch x86_64 -dylib %s -o libwibble.dylib
# RUN: macho-dump libwibble.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE
# RUN: rm -f libwibble.dylib

--- !mach-o
arch:            x86_64
file-type:       MH_OBJECT
flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
has-UUID:        false
OS:              unknown
sections:
  - segment:         __TEXT
    section:         __text
    type:            S_REGULAR
    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
    alignment:       4
    address:         0x0000000000000000
    content:         [ 0xCC, 0xC3, 0x90, 0xC3, 0x90, 0x90, 0xC3, 0x90,
                       0x90, 0x90, 0xC3, 0x90, 0x90, 0x90, 0x90, 0xC3,
                       0x31, 0xC0, 0xC3 ]
local-symbols:
  - name:            _myStatic
    type:            N_SECT
    sect:            1
    value:           0x000000000000000B
global-symbols:
  - name:            _myGlobal
    type:            N_SECT
    scope:           [ N_EXT ]
    sect:            1
    value:           0x0000000000000001
...


# CHECK-BINARY-WRITE: (('command', 13)
# CHECK-BINARY-WRITE-NEXT:  ('size', 40)
# CHECK-BINARY-WRITE-NEXT:  ('install_name', 'libwibble.dylib')

# CHECK-BINARY-READ: shared-library-atoms:
# CHECK-BINARY-READ:     - name:          _myGlobal
# CHECK-BINARY-READ:       load-name:     libwibble.dylib
{'fraction_non_alphanumeric': 0.11426491994177583, 'fraction_numerical': 0.0606501698204755, 'mean_word_length': 2.223612197028929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5814704', 'n_tokens_mistral': 1735, 'n_tokens_neox': 1530, 'n_words': 351}