brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 5635731 Raw
47 lines · plain
1; REQUIRES: x862 3;; For non-relocatable output, test we parse symbol versions after LTO,4;; otherwise we may get a symbol named "foo@@VER1", but not "foo" with the5;; version VER1.6 7; RUN: split-file %s %t8; RUN: llvm-as %t/ir -o %t.o9; RUN: llvm-mc -filetype=obj -triple=x86_64 %t/asm -o %tbar.o10; RUN: ld.lld %tbar.o -shared --soname=tbar --version-script %t/ver -o %tbar.so11 12;; Emit an error if bar@VER1 is not defined.13; RUN: not ld.lld %t.o -o /dev/null -shared --version-script %t/ver 2>&1 | FileCheck %s --check-prefix=UNDEF14 15; UNDEF: error: undefined symbol: bar@VER116 17; RUN: ld.lld %t.o %tbar.so -o %t.so -shared --version-script %t/ver18; RUN: llvm-readelf --dyn-syms %t.so | FileCheck %s19 20; CHECK:      UND       bar@VER1{{$}}21; CHECK-NEXT: {{[1-9]}} foo@@VER1{{$}}22 23;; For relocatable output, @ should be retained in the symbol name.24;; Don't parse and drop `@VER1`. Also check that --version-script is ignored.25; RUN: ld.lld %t.o -o %t.ro -r --version-script %t/ver26; RUN: llvm-readelf -s %t.ro | FileCheck %s --check-prefix=RELOCATABLE27 28; RELOCATABLE:      {{[1-9]}} foo@@VER1{{$}}29; RELOCATABLE-NEXT: UND       bar@VER1{{$}}30 31;--- ver32VER1 {};33;--- ir34target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"35target triple = "x86_64-unknown-linux-gnu"36 37module asm ".global foo"38module asm "foo: call bar"39module asm ".symver foo,foo@@@VER1"40module asm ".symver bar,bar@@@VER1"41 42;--- asm43.globl bar44.symver bar,bar@@@VER145bar:46  ret47