[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / lld / test / ELF / cref.s
blobad87a419a55f8d7eee0d71e56bc1e47a25153348
1 // REQUIRES: x86
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: echo 'abs1 = 42;' > %t.lds
7 // RUN: rm -f %t.a
8 // RUN: llvm-ar rcs %t.a %ta.o
9 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t3.o
10 // RUN: ld.lld -shared -o %t1.so %t1.o
11 // RUN: ld.lld -o /dev/null %t1.so %t2.o %t3.o %t.a %t.a %t.lds --defsym abs2=43 --gc-sections --cref | FileCheck -strict-whitespace %s
13 /// If -Map is specified, print to the map file.
14 // RUN: ld.lld -o /dev/null %t1.so %t2.o %t3.o %t.a --gc-sections -Map=%t.map --cref
15 // RUN: FileCheck --input-file=%t.map %s --check-prefix=CHECK2
17 // CHECK: {{^$}}
18 // CHECK-NEXT: Cross Reference Table
19 // CHECK-EMPTY:
20 // CHECK-NEXT: Symbol File
21 // CHECK-NEXT: foo {{.*}}1.so
22 // CHECK-NEXT: {{.*}}2.o
23 // CHECK-NEXT: {{.*}}3.o
24 // CHECK-NEXT: bar {{.*}}2.o
25 // CHECK-NEXT: {{.*}}3.o
26 // CHECK-NEXT: _start {{.*}}3.o
27 // CHECK-NEXT: baz {{.*}}3.o
28 // CHECK-NEXT: zed {{.*}}.a({{.*}}a.o)
29 // CHECK-NEXT: {{.*}}3.o
30 // CHECK-NEXT: abs1 {{.*}}.lds:1
31 // CHECK-NEXT: {{.*}}3.o
32 // CHECK-NEXT: abs2 --defsym{{$}}
33 // CHECK-NEXT: {{.*}}3.o
34 // CHECK-NOT: discarded
36 // CHECK2: VMA LMA Size Align Out In Symbol
37 // CHECK2: .strtab
38 // CHECK2-NEXT: <internal>:(.strtab)
40 /// There is a blank line before the "Cross Reference Table" header.
41 // CHECK2-EMPTY:
42 // CHECK2-NEXT: Cross Reference Table
44 .global _start, foo, bar, baz, discarded
45 _start:
46 call foo
47 call bar
48 call zed
49 localsym:
50 baz:
52 .section .text.a,"ax",@progbits
53 discarded:
55 .data
56 .quad abs1
57 .quad abs2