1# RUN: ld64.lld -arch i386 -r -print_atoms %s -o %t  | FileCheck %s \
2# RUN: && ld64.lld -arch i386 -r -print_atoms %t -o %t2  | FileCheck %s
3#
4# Test parsing LC_DATA_IN_CODE
5#
6#
7
8--- !mach-o
9arch:            x86
10file-type:       MH_OBJECT
11flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
12sections:
13  - segment:         __TEXT
14    section:         __text
15    type:            S_REGULAR
16    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
17    address:         0x0000000000000000
18    content:         [ 0x90, 0x90, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00,
19                       0x00, 0x00, 0x90, 0x90, 0x90, 0x90, 0x03, 0x00,
20                       0x00, 0x00 ]
21local-symbols:
22  - name:            _func1
23    type:            N_SECT
24    sect:            1
25    value:           0x0000000000000000
26  - name:            _func2
27    type:            N_SECT
28    sect:            1
29    value:           0x000000000000000B
30dataInCode:
31  - offset:          0x00000002
32    length:          0x0008
33    kind:            DICE_KIND_JUMP_TABLE32
34  - offset:          0x0000000E
35    length:          0x0004
36    kind:            DICE_KIND_JUMP_TABLE32
37...
38
39
40
41# CHECK: defined-atoms:
42# CHECK:   - name:            _func1
43# CHECK:     references:
44# CHECK:       - kind:            modeData
45# CHECK:         offset:          2
46# CHECK:         addend:          4
47# CHECK:       - kind:            modeCode
48# CHECK:         offset:          10
49# CHECK:   - name:            _func2
50# CHECK:     references:
51# CHECK:       - kind:            modeData
52# CHECK:         offset:          3
53# CHECK:         addend:          4
54# CHECK-NOT:   - kind:            modeData
55
56
57
58
59#
60#_func1:
61#  nop
62#  nop
63#  .data_region jt32
64#  .long 1
65#  .long 2
66#  .end_data_region
67#  nop
68#
69#
70# _func2:
71#  nop
72#  nop
73#  nop
74#  .data_region jt32
75#  .long 3
76#  .end_data_region
77#
78