2 ;; Show that resolution of weak + global symbols works correctly when one is
3 ;; defined in native object and the other in a bitcode file.
4 ;; The global symbol in both cases should be kept. LTO should throw away the
5 ;; data for the discarded weak symbol defined in bitcode. The data for the
6 ;; weak symbol in a native object will be kept, but will be unlabelled.
9 ; RUN: split-file %s %t.dir
10 ; RUN: llvm-as %t.dir/1.ll -o %t1.o
11 ; RUN: llvm-mc -triple=x86_64-pc-linux %t.dir/2.s -o %t2.o -filetype=obj
12 ; RUN: ld.lld %t1.o %t2.o -o %t.so -shared
13 ; RUN: llvm-readobj --symbols -S --section-data %t.so | FileCheck %s
16 ; CHECK-NEXT: Type: SHT_PROGBITS
18 ; CHECK-NEXT: SHF_ALLOC
19 ; CHECK-NEXT: SHF_WRITE
21 ; CHECK-NEXT: Address: 0x[[#%x,ADDR:]]
23 ; CHECK-NEXT: Size: 12
26 ; CHECK-NEXT: AddressAlignment:
27 ; CHECK-NEXT: EntrySize:
28 ; CHECK-NEXT: SectionData (
29 ; CHECK-NEXT: 0000: 09000000 05000000 04000000 |{{.*}}|
33 ; CHECK-NEXT: Value: 0x[[#%x,ADDR]]
36 ; CHECK-NEXT: Value: 0x[[#%x,ADDR+8]]
39 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
40 target triple = "x86_64-unknown-linux-gnu"
42 @a = weak global i32 8