Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / unsorted-relocations.yaml
blob11dbc3c3bdc0dc00c6c160cb5e75639f4068d528
1 # REQUIRES: x86
3 ## This tests that we can handle relocations that are not sorted by address.
4 ## llvm-mc isn't able to emit such a file, hence the use of yaml2obj. ld64
5 ## may emit files with unsorted relocations in `-r` mode, so we need to support
6 ## this.
8 # RUN: yaml2obj %s -o %t.o
9 # RUN: %lld -dylib -o %t %t.o
10 # RUN: llvm-objdump --macho -d %t | FileCheck %s
12 # CHECK:      _foo:
13 # CHECK-NEXT:      movq    _bar(%rip), %rax
14 # CHECK-NEXT: _bar:
15 # CHECK-NEXT:      movq    _baz(%rip), %rax
16 # CHECK-NEXT: _baz:
17 # CHECK-NEXT:      movq    _foo(%rip), %rax
19 --- !mach-o
20 FileHeader:
21   magic:           0xFEEDFACF
22   cputype:         0x1000007
23   cpusubtype:      0x3
24   filetype:        0x1
25   ncmds:           2
26   sizeofcmds:      280
27   flags:           0x2000
28   reserved:        0x0
29 LoadCommands:
30   - cmd:             LC_SEGMENT_64
31     cmdsize:         152
32     segname:         ''
33     vmaddr:          0
34     vmsize:          21
35     fileoff:         312
36     filesize:        21
37     maxprot:         7
38     initprot:        7
39     nsects:          1
40     flags:           0
41     Sections:
42       - sectname:        __text
43         segname:         __TEXT
44         addr:            0x0
45         size:            21
46         offset:          0x138
47         align:           0
48         reloff:          0x150
49         nreloc:          3
50         flags:           0x80000400
51         reserved1:       0x0
52         reserved2:       0x0
53         reserved3:       0x0
54         content:         488B0500000000488B0500000000488B0500000000
55         relocations:
56           - address:         0x3
57             symbolnum:       1
58             pcrel:           true
59             length:          2
60             extern:          true
61             type:            1
62             scattered:       false
63             value:           0
64           - address:         0x11
65             symbolnum:       0
66             pcrel:           true
67             length:          2
68             extern:          true
69             type:            1
70             scattered:       false
71             value:           0
72           - address:         0xA
73             symbolnum:       2
74             pcrel:           true
75             length:          2
76             extern:          true
77             type:            1
78             scattered:       false
79             value:           0
80   - cmd:             LC_SYMTAB
81     cmdsize:         24
82     symoff:          360
83     nsyms:           3
84     stroff:          408
85     strsize:         16
86 LinkEditData:
87   NameList:
88     - n_strx:          11
89       n_type:          0xE
90       n_sect:          1
91       n_desc:          0
92       n_value:         0
93     - n_strx:          6
94       n_type:          0xE
95       n_sect:          1
96       n_desc:          0
97       n_value:         7
98     - n_strx:          1
99       n_type:          0xE
100       n_sect:          1
101       n_desc:          0
102       n_value:         14
103   StringTable:
104     - ''
105     - _baz
106     - _bar
107     - _foo