Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / invalid / dso-handle-duplicate.s
blobba9d04af6bfb1cf07a6fa83fe5d02058e5dc181c
1 # REQUIRES: x86
3 ## If for some bizarre reason the input file defines its own ___dso_handle, we
4 ## should raise an error. At least, we've implemented this behavior if the
5 ## conflicting symbol is a global. A local symbol of the same name will still
6 ## take priority in our implementation, unlike in ld64. But that's a pretty
7 ## far-out edge case that should be safe to ignore.
9 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
10 # RUN: not %lld -dylib %t.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t.o
11 # CHECK: error: duplicate symbol: ___dso_handle
12 # CHECK-NEXT: >>> defined in [[FILE]]
13 # CHECK-NEXT: >>> defined in <internal>
15 .globl _main, ___dso_handle
16 .text
17 _main:
18 leaq ___dso_handle(%rip), %rdx
19 ret
21 ___dso_handle:
22 .space 1