brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 135bdf1 Raw
66 lines · plain
1; RUN: llvm-as %s -o %t1.o2; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o3; RUN: %gold -shared -o %t3.o -plugin %llvmshlibdir/LLVMgold%shlibext %t1.o %t2.o \4; RUN:  -m elf_x86_64 \5; RUN:  -plugin-opt=save-temps6; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt7; RUN: llvm-readobj --symbols %t3.o | FileCheck --check-prefix=OBJ %s8 9target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"10target triple = "x86_64-unknown-linux-gnu"11 12$c1 = comdat any13 14@v1 = weak_odr global i32 42, comdat($c1)15define weak_odr i32 @f1(ptr) comdat($c1) {16bb10:17  br label %bb1118bb11:19  ret i32 4220}21 22@r11 = global ptr @v123@r12 = global ptr @f124 25@a11 = alias i32, ptr @v126@a12 = alias i16, ptr @v127 28@a13 = alias i32 (ptr), ptr @f129@a14 = alias i16, ptr @f130@a15 = alias i16, ptr @a1431 32; gold's resolutions should tell us that our $c1 wins, and the other input's $c233; wins. f1 is also local due to having protected visibility in the other object.34 35; RES: 1.o,f1,plx{{$}}36; RES: 1.o,v1,px{{$}}37; RES: 1.o,r11,px{{$}}38; RES: 1.o,r12,px{{$}}39; RES: 1.o,a11,px{{$}}40; RES: 1.o,a12,px{{$}}41; RES: 1.o,a13,px{{$}}42; RES: 1.o,a14,px{{$}}43; RES: 1.o,a15,px{{$}}44 45; RES: 2.o,f1,l{{$}}46; RES: 2.o,will_be_undefined,{{$}}47; RES: 2.o,v1,{{$}}48; RES: 2.o,r21,px{{$}}49; RES: 2.o,r22,px{{$}}50; RES: 2.o,a21,px{{$}}51; RES: 2.o,a22,px{{$}}52; RES: 2.o,a23,px{{$}}53; RES: 2.o,a24,px{{$}}54; RES: 2.o,a25,px{{$}}55 56; f1's protected visibility should be reflected in the DSO.57 58; OBJ:      Name: f1 (59; OBJ-NEXT: Value:60; OBJ-NEXT: Size:61; OBJ-NEXT: Binding:62; OBJ-NEXT: Type:63; OBJ-NEXT: Other [64; OBJ-NEXT:   STV_PROTECTED65; OBJ-NEXT: ]66