xref: /llvm-project-15.0.7/lld/test/ELF/allow-multiple-definition.s (revision f4debddb)
  • 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 %t3
6# RUN: ld.lld --allow-multiple-definition %t1 %t2 -o %t3
7# RUN: ld.lld --allow-multiple-definition %t2 %t1 -o %t4
8# RUN: llvm-objdump -d %t3 | FileCheck %s
9# RUN: llvm-objdump -d %t4 | FileCheck -check-prefix=REVERT %s
10
11# inputs contain different constants for instuction movl.
12# Tests below checks that order of files in command line
13# affects on what symbol will be used.
14# If flag allow-multiple-definition is enabled the first
15# meet symbol should be used.
16
17# CHECK: _bar:
18# CHECK-NEXT: 201000:   b8 01 00 00 00   movl   $1, %eax
19
20# REVERT: _bar:
21# REVERT-NEXT: 201000:   b8 02 00 00 00   movl   $2, %eax
22
23.globl _bar
24.type _bar, @function
25_bar:
26  mov $1, %eax
27
28.globl _start
29_start:
30

served by {OpenGrok

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