# REQUIRES: aarch64

# RUN: yaml2obj %s -o %t.out

# RUN: %lldb %t.out -b -o "disassemble -c 1 --cpu 'apple-a16' -n main" | FileCheck %s --check-prefix SUPPORTED
# RUN: %lldb %t.out -b -o "disassemble -c 1 --cpu 'apple-a11' -n main" | FileCheck %s --check-prefix UNSUPPORTED
# RUN: %lldb %t.out -b -o "disassemble -c 1 --cpu 'apple-a11' --features '+all' -n main" | FileCheck %s --check-prefix SUPPORTED

# RUN: %lldb %t.out -b -o "settings set target.disassembly-cpu 'apple-a16'" -o "disassemble -c 1 -n main" | FileCheck %s --check-prefix SUPPORTED
# RUN: %lldb %t.out -b -o "settings set target.disassembly-cpu 'apple-a11'" -o "disassemble -c 1 -n main" | FileCheck %s --check-prefix UNSUPPORTED
# RUN: %lldb %t.out -b -o "settings set target.disassembly-cpu 'apple-a11'" -o "settings set target.disassembly-features '+all'" -o "disassemble -c 1 -n main" | FileCheck %s --check-prefix SUPPORTED

# SUPPORTED: <+0>: pacibsp
# UNSUPPORTED-NOT: <+0>: pacibsp

--- !mach-o
FileHeader:
  magic:           0xFEEDFACF
  cputype:         0x100000C
  cpusubtype:      0x80000002
  filetype:        0x2
  ncmds:           17
  sizeofcmds:      1056
  flags:           0x200085
  reserved:        0x0
LoadCommands:
  - cmd:             LC_SEGMENT_64
    cmdsize:         72
    segname:         __PAGEZERO
    vmaddr:          0
    vmsize:          4294967296
    fileoff:         0
    filesize:        0
    maxprot:         0
    initprot:        0
    nsects:          0
    flags:           0
  - cmd:             LC_SEGMENT_64
    cmdsize:         392
    segname:         __TEXT
    vmaddr:          4294967296
    vmsize:          16384
    fileoff:         0
    filesize:        16384
    maxprot:         5
    initprot:        5
    nsects:          4
    flags:           0
    Sections:
      - sectname:        __text
        segname:         __TEXT
        addr:            0x100000460
        size:            36
        offset:          0x460
        align:           2
        reloff:          0x0
        nreloc:          0
        flags:           0x80000400
        reserved1:       0x0
        reserved2:       0x0
        reserved3:       0x0
        content:         7F2303D5FD7BBFA9FD03009100000090005012910400009400008052FD7BC1A8FF0F5FD6
      - sectname:        __cstring
        segname:         __TEXT
        addr:            0x100000494
        size:            3
        offset:          0x494
        align:           0
        reloff:          0x0
        nreloc:          0
        flags:           0x2
        reserved1:       0x0
        reserved2:       0x0
        reserved3:       0x0
        content:         '484900'
  - cmd:             LC_SEGMENT_64
    cmdsize:         152
    segname:         __DATA_CONST
    vmaddr:          4294983680
    vmsize:          16384
    fileoff:         16384
    filesize:        16384
    maxprot:         3
    initprot:        3
    nsects:          1
    flags:           16
  - cmd:             LC_SEGMENT_64
    cmdsize:         72
    segname:         __LINKEDIT
    vmaddr:          4295000064
    vmsize:          16384
    fileoff:         32768
    filesize:        664
    maxprot:         1
    initprot:        1
    nsects:          0
    flags:           0
  - cmd:             LC_SYMTAB
    cmdsize:         24
    symoff:          32920
    nsyms:           3
    stroff:          32976
    strsize:         40
  - cmd:             LC_DYSYMTAB
    cmdsize:         80
    ilocalsym:       0
    nlocalsym:       0
    iextdefsym:      0
    nextdefsym:      2
    iundefsym:       2
    nundefsym:       1
    tocoff:          0
    ntoc:            0
    modtaboff:       0
    nmodtab:         0
    extrefsymoff:    0
    nextrefsyms:     0
    indirectsymoff:  32968
    nindirectsyms:   2
    extreloff:       0
    nextrel:         0
    locreloff:       0
    nlocrel:         0
  - cmd:             LC_LOAD_DYLINKER
    cmdsize:         32
    name:            12
    Content:         '/usr/lib/dyld'
    ZeroPadBytes:    7
  - cmd:             LC_UUID
    cmdsize:         24
    uuid:            CF3EBEFA-8D83-3C25-931A-5AF74AFE0B3A
  - cmd:             LC_BUILD_VERSION
    cmdsize:         32
    platform:        1
    minos:           983040
    sdk:             983808
    ntools:          1
    Tools:
      - tool:            3
        version:         76153600
  - cmd:             LC_SOURCE_VERSION
    cmdsize:         16
    version:         0
  - cmd:             LC_MAIN
    cmdsize:         24
    entryoff:        1120
    stacksize:       0
  - cmd:             LC_LOAD_DYLIB
    cmdsize:         56
    dylib:
      name:            24
      timestamp:       2
      current_version: 88539136
      compatibility_version: 65536
    Content:         '/usr/lib/libSystem.B.dylib'
    ZeroPadBytes:    6
  - cmd:             LC_FUNCTION_STARTS
    cmdsize:         16
    dataoff:         32912
    datasize:        8
  - cmd:             LC_DATA_IN_CODE
    cmdsize:         16
    dataoff:         32920
    datasize:        0
  - cmd:             LC_CODE_SIGNATURE
    cmdsize:         16
    dataoff:         33024
    datasize:        408
LinkEditData:
  ExportTrie:
    TerminalSize:    0
    NodeOffset:      0
    Name:            ''
    Flags:           0x0
    Address:         0x0
    Other:           0x0
    ImportName:      ''
    Children:
      - TerminalSize:    0
        NodeOffset:      18
        Name:            _
        Flags:           0x0
        Address:         0x0
        Other:           0x0
        ImportName:      ''
        Children:
          - TerminalSize:    2
            NodeOffset:      9
            Name:            _mh_execute_header
            Flags:           0x0
            Address:         0x0
            Other:           0x0
            ImportName:      ''
          - TerminalSize:    3
            NodeOffset:      13
            Name:            main
            Flags:           0x0
            Address:         0x460
            Other:           0x0
            ImportName:      ''
  NameList:
    - n_strx:          2
      n_type:          0xF
      n_sect:          1
      n_desc:          16
      n_value:         4294967296
    - n_strx:          22
      n_type:          0xF
      n_sect:          1
      n_desc:          0
      n_value:         4294968416
    - n_strx:          28
      n_type:          0x1
      n_sect:          0
      n_desc:          256
      n_value:         0
  StringTable:
    - ' '
    - __mh_execute_header
    - _main
    - _puts
    - ''
    - ''
    - ''
    - ''
    - ''
    - ''
  IndirectSymbols: [ 0x2, 0x2 ]
  FunctionStarts:  [ 0x460 ]
...
