• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// REQUIRES: x86
2
3// RUN: echo '.global foo; foo:' | llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %t1.o
4// RUN: echo '.global foo, bar; bar:' | llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %t2.o
5// RUN: echo '.global zed; zed:' | llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %ta.o
6// RUN: rm -f %t.a
7// RUN: llvm-ar rcs %t.a %ta.o
8// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t3.o
9// RUN: ld.lld -shared -o %t1.so %t1.o
10// RUN: ld.lld -o /dev/null %t1.so %t2.o %t3.o %t.a -gc-sections -cref | FileCheck -strict-whitespace %s
11
12//      CHECK: Symbol                                            File
13// CHECK-NEXT: bar                                               {{.*}}2.o
14// CHECK-NEXT:                                                   {{.*}}3.o
15// CHECK-NEXT: foo                                               {{.*}}1.so
16// CHECK-NEXT:                                                   {{.*}}2.o
17// CHECK-NEXT:                                                   {{.*}}3.o
18// CHECK-NEXT: _start                                            {{.*}}3.o
19// CHECK-NEXT: baz                                               {{.*}}3.o
20// CHECK-NEXT: zed                                               {{.*}}.a({{.*}}a.o)
21// CHECK-NEXT:                                                   {{.*}}3.o
22// CHECK-NOT:  discarded
23
24.global _start, foo, bar, baz, discarded
25_start:
26  call foo
27  call bar
28  call zed
29localsym:
30baz:
31
32.section .text.a,"ax",@progbits
33discarded:
34