1# REQUIRES: x86
2
3# We have a code in LLD that prevents fetching the same object from archive file twice.
4# This test triggers that code, without it we would fail to link output.
5
6# RUN: echo '.globl foo, bar; foo:' | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %tfoo.o
7# RUN: echo '.globl foo, bar; bar:' | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %tbar.o
8# RUN: rm -f %t.a
9# RUN: llvm-ar rcs %t.a %tfoo.o %tbar.o
10
11# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
12# RUN: ld.lld %t.a %t.o -o %t
13# RUN: llvm-nm %t | FileCheck %s
14
15# RUN: ld.lld -shared %t.o -o %t.so
16# RUN: ld.lld %t.a %t.so -o %t
17# RUN: llvm-nm %t | FileCheck %s
18
19# CHECK: T foo
20
21_start:
22callq foo
23