1// REQUIRES: x86
2// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
3// RUN: rm -f %t1.a
4// RUN: llvm-ar rc %t1.a %t1.o
5// RUN: ld.lld %t1.o -o %t1.so -shared
6// RUN: echo ".global foo" > %t2.s
7// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t2.s -o %t2.o
8// RUN: ld.lld %t1.a %t1.so %t2.o -o %t.so -shared
9// RUN: llvm-readelf --dyn-symbols %t.so | FileCheck %s
10
11// Test that 'foo' from %t1.so is used and we don't fetch a member
12// from the archive.
13
14// CHECK: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND foo
15
16.global foo
17foo:
18