2 ; RUN: llvm-as %s -o %t1.o
3 ; RUN: llvm-as %p/Inputs/weakodr-visibility.ll -o %t2.o
5 ; Testcase checks we keep desired visibility of weak
6 ; symbol in a library even if select different definition.
7 ; We change the order of input files in command line and
8 ; check that linker selects different symbol definitions,
9 ; but keeps `protected` visibility.
11 ; RUN: ld.lld %t1.o %t2.o -o %t.so -shared
12 ; RUN: llvm-readobj --symbols %t.so | FileCheck %s
13 ; RUN: llvm-objdump --no-print-imm-hex -d %t.so | FileCheck %s --check-prefix=FIRST
18 ; CHECK-NEXT: Binding: Weak
19 ; CHECK-NEXT: Type: Function
21 ; CHECK-NEXT: STV_PROTECTED
23 ; CHECK-NEXT: Section:
26 ; FIRST-NEXT: movl $41, %eax
28 ; Now swap the files order.
29 ; RUN: ld.lld %t2.o %t1.o -o %t.so -shared
30 ; RUN: llvm-readobj --symbols %t.so | FileCheck %s
31 ; RUN: llvm-objdump --no-print-imm-hex -d %t.so | FileCheck %s --check-prefix=SECOND
33 ; SECOND-NEXT: movl $42, %eax
35 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
36 target triple = "x86_64-unknown-linux-gnu"
38 define weak_odr i32 @foo(ptr %this) {