1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3# RUN: echo "LIBSAMPLE_1.0 { global: a; local: *; };" > %t.script
4# RUN: echo "LIBSAMPLE_2.0 { global: b; local: *; } LIBSAMPLE_1.0;" >> %t.script
5# RUN: echo "LIBSAMPLE_3.0 { global: c; } LIBSAMPLE_2.0;" >> %t.script
6# RUN: ld.lld --version-script %t.script -shared -soname shared %t.o -o %t.so
7# RUN: llvm-readobj -V --dyn-syms %t.so | FileCheck --check-prefix=DSO %s
8
9# DSO:      VersionDefinitions [
10# DSO-NEXT:   Definition {
11# DSO-NEXT:     Version: 1
12# DSO-NEXT:     Flags [ (0x1)
13# DSO-NEXT:       Base (0x1)
14# DSO-NEXT:     ]
15# DSO-NEXT:     Index: 1
16# DSO-NEXT:     Hash: 127830196
17# DSO-NEXT:     Name: shared
18# DSO-NEXT:     Predecessors: []
19# DSO-NEXT:   }
20# DSO-NEXT:   Definition {
21# DSO-NEXT:     Version: 1
22# DSO-NEXT:     Flags [ (0x0)
23# DSO-NEXT:     ]
24# DSO-NEXT:     Index: 2
25# DSO-NEXT:     Hash: 98457184
26# DSO-NEXT:     Name: LIBSAMPLE_1.0
27# DSO-NEXT:     Predecessors: []
28# DSO-NEXT:   }
29# DSO-NEXT:   Definition {
30# DSO-NEXT:     Version: 1
31# DSO-NEXT:     Flags [ (0x0)
32# DSO-NEXT:     ]
33# DSO-NEXT:     Index: 3
34# DSO-NEXT:     Hash: 98456416
35# DSO-NEXT:     Name: LIBSAMPLE_2.0
36# DSO-NEXT:     Predecessors: []
37# DSO-NEXT:   }
38# DSO-NEXT:   Definition {
39# DSO-NEXT:     Version: 1
40# DSO-NEXT:     Flags [ (0x0)
41# DSO-NEXT:     ]
42# DSO-NEXT:     Index: 4
43# DSO-NEXT:     Hash: 98456672
44# DSO-NEXT:     Name: LIBSAMPLE_3.0
45# DSO-NEXT:     Predecessors: []
46# DSO-NEXT:   }
47# DSO-NEXT: ]
48