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 the
7 ; RUN: split-file %s %t
8 ; RUN: llvm-as %t/ir -o %t.o
9 ; RUN: llvm-mc -filetype=obj -triple=x86_64 %t/asm -o %tbar.o
10 ; RUN: ld.lld %tbar.o -shared --soname=tbar --version-script %t/ver -o %tbar.so
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=UNDEF
15 ; UNDEF: error: undefined symbol: bar@VER1
17 ; RUN: ld.lld %t.o %tbar.so -o %t.so -shared --version-script %t/ver
18 ; RUN: llvm-readelf --dyn-syms %t.so | FileCheck %s
21 ; CHECK-NEXT: {{[1-9]}} foo@@VER1
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/ver
26 ; RUN: llvm-readelf -s %t.ro | FileCheck %s --check-prefix=RELOCATABLE
28 ; RELOCATABLE: {{[1-9]}} foo@@VER1
29 ; RELOCATABLE-NEXT: UND bar@VER1
34 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
35 target triple = "x86_64-unknown-linux-gnu"
37 module asm ".global foo"
38 module asm "foo: call bar"
39 module asm ".symver foo,foo@@@VER1"
40 module asm ".symver bar,bar@@@VER1"
44 .symver bar,bar@@@VER1