xref: /llvm-project-15.0.7/lld/test/ELF/allow-multiple-definition.s (revision fbdcfcd4)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: x86
2
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 -d %t3 | FileCheck %s
10# RUN: llvm-objdump -d %t4 | FileCheck --check-prefix=REVERT %s
11
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 -d %t3 | FileCheck %s
15# RUN: llvm-objdump -d %t4 | FileCheck --check-prefix=REVERT %s
16
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.
22
23# CHECK: <_bar>:
24# CHECK-NEXT:  movl   $1, %eax
25
26# REVERT: <_bar>:
27# REVERT-NEXT: movl   $2, %eax
28
29.globl _bar
30.type _bar, @function
31_bar:
32  mov $1, %eax
33
34.globl _start
35_start:
36

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026