Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / allow-multiple-definition.s
blob492784a3601df18f18bc071d22262cd28fc521f3
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/allow-multiple-definition.s -o %t2
5 # RUN: not ld.lld %t1 %t2 -o /dev/null
6 # RUN: not ld.lld --allow-multiple-definition --no-allow-multiple-definition %t1 %t2 -o /dev/null
7 # RUN: ld.lld --allow-multiple-definition --fatal-warnings %t1 %t2 -o %t3
8 # RUN: ld.lld --allow-multiple-definition --fatal-warnings %t2 %t1 -o %t4
9 # RUN: llvm-objdump --no-print-imm-hex -d %t3 | FileCheck %s
10 # RUN: llvm-objdump --no-print-imm-hex -d %t4 | FileCheck --check-prefix=REVERT %s
12 # RUN: ld.lld -z muldefs --fatal-warnings %t1 %t2 -o %t3
13 # RUN: ld.lld -z muldefs --fatal-warnings %t2 %t1 -o %t4
14 # RUN: llvm-objdump --no-print-imm-hex -d %t3 | FileCheck %s
15 # RUN: llvm-objdump --no-print-imm-hex -d %t4 | FileCheck --check-prefix=REVERT %s
17 # inputs contain different constants for instruction movl.
18 # Tests below checks that order of files in command line
19 # affects on what symbol will be used.
20 # If flag allow-multiple-definition is enabled the first
21 # meet symbol should be used.
23 # CHECK: <_bar>:
24 # CHECK-NEXT: movl $1, %eax
26 # REVERT: <_bar>:
27 # REVERT-NEXT: movl $2, %eax
29 .globl _bar
30 .type _bar, @function
31 _bar:
32 mov $1, %eax
34 .globl _start
35 _start: