2015-09-29 04:30:11 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/allow-multiple-definition.s -o %t2
|
2020-02-13 13:48:45 +08:00
|
|
|
# RUN: not ld.lld %t1 %t2 -o /dev/null
|
|
|
|
# RUN: not ld.lld --allow-multiple-definition --no-allow-multiple-definition %t1 %t2 -o /dev/null
|
2018-03-20 07:04:04 +08:00
|
|
|
# RUN: ld.lld --allow-multiple-definition --fatal-warnings %t1 %t2 -o %t3
|
|
|
|
# RUN: ld.lld --allow-multiple-definition --fatal-warnings %t2 %t1 -o %t4
|
2015-09-29 04:30:11 +08:00
|
|
|
# RUN: llvm-objdump -d %t3 | FileCheck %s
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -d %t4 | FileCheck --check-prefix=REVERT %s
|
2015-09-29 04:30:11 +08:00
|
|
|
|
2018-03-20 07:04:04 +08:00
|
|
|
# RUN: ld.lld -z muldefs --fatal-warnings %t1 %t2 -o %t3
|
|
|
|
# RUN: ld.lld -z muldefs --fatal-warnings %t2 %t1 -o %t4
|
2017-08-12 04:49:48 +08:00
|
|
|
# RUN: llvm-objdump -d %t3 | FileCheck %s
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -d %t4 | FileCheck --check-prefix=REVERT %s
|
2017-08-12 04:49:48 +08:00
|
|
|
|
2020-04-02 00:21:08 +08:00
|
|
|
# inputs contain different constants for instruction movl.
|
2015-09-29 04:30:11 +08:00
|
|
|
# Tests below checks that order of files in command line
|
|
|
|
# affects on what symbol will be used.
|
|
|
|
# If flag allow-multiple-definition is enabled the first
|
|
|
|
# meet symbol should be used.
|
|
|
|
|
2020-03-06 06:18:38 +08:00
|
|
|
# CHECK: <_bar>:
|
2019-09-06 23:10:31 +08:00
|
|
|
# CHECK-NEXT: movl $1, %eax
|
2015-09-29 04:30:11 +08:00
|
|
|
|
2020-03-06 06:18:38 +08:00
|
|
|
# REVERT: <_bar>:
|
2019-09-06 23:10:31 +08:00
|
|
|
# REVERT-NEXT: movl $2, %eax
|
2015-09-29 04:30:11 +08:00
|
|
|
|
|
|
|
.globl _bar
|
|
|
|
.type _bar, @function
|
|
|
|
_bar:
|
|
|
|
mov $1, %eax
|
|
|
|
|
|
|
|
.globl _start
|
|
|
|
_start:
|