• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/undef.s -o %t2.o
4# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/undef-debug.s -o %t3.o
5# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/undef-bad-debug.s -o %t4.o
6# RUN: rm -f %t2.a
7# RUN: llvm-ar rc %t2.a %t2.o
8# RUN: not ld.lld %t.o %t2.a %t3.o %t4.o -o /dev/null 2>&1 \
9# RUN:   | FileCheck %s --implicit-check-not="error:" --implicit-check-not="warning:"
10# RUN: not ld.lld -pie %t.o %t2.a %t3.o %t4.o -o /dev/null 2>&1 \
11# RUN:   | FileCheck %s --implicit-check-not="error:" --implicit-check-not="warning:"
12
13# CHECK:      error: undefined symbol: foo
14# CHECK-NEXT: >>> referenced by undef.s
15# CHECK-NEXT:                   {{.*}}:(.text+0x1)
16
17# CHECK:      error: undefined symbol: bar
18# CHECK-NEXT: >>> referenced by undef.s
19# CHECK-NEXT: >>>               {{.*}}:(.text+0x6)
20
21# CHECK:      error: undefined symbol: foo(int)
22# CHECK-NEXT: >>> referenced by undef.s
23# CHECK-NEXT: >>>               {{.*}}:(.text+0x10)
24
25# CHECK:      error: undefined symbol: vtable for Foo
26# CHECK-NEXT: >>> referenced by undef.s
27# CHECK-NEXT: >>>               {{.*}}:(.text+0x15)
28# CHECK-NEXT: >>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
29
30# CHECK:      error: undefined symbol: foo(int)
31# CHECK-NEXT: >>> referenced by undef.s
32# CHECK-NEXT: >>>               {{.*}}:(.text+0x1A)
33
34# CHECK:      error: undefined symbol: zed2
35# CHECK-NEXT: >>> referenced by {{.*}}.o:(.text+0x0) in archive {{.*}}2.a
36
37# CHECK:      error: undefined symbol: zed3
38# CHECK-NEXT: >>> referenced by undef-debug.s:3 (dir{{/|\\}}undef-debug.s:3)
39# CHECK-NEXT: >>>               {{.*}}.o:(.text+0x0)
40
41# CHECK:      error: undefined symbol: zed4
42# CHECK-NEXT: >>> referenced by undef-debug.s:7 (dir{{/|\\}}undef-debug.s:7)
43# CHECK-NEXT: >>>               {{.*}}.o:(.text.1+0x0)
44
45# CHECK:      error: undefined symbol: zed5
46# CHECK-NEXT: >>> referenced by undef-debug.s:11 (dir{{/|\\}}undef-debug.s:11)
47# CHECK-NEXT: >>>               {{.*}}.o:(.text.2+0x0)
48
49# Show that all line table problems are mentioned as soon as the object's line information
50# is requested, even if that particular part of the line information is not currently required.
51# Also show that the warnings are only printed once.
52# CHECK:      warning: unknown data in line table prologue at offset 0x00000000: parsing ended (at offset 0x00000037) before reaching the prologue end at offset 0x00000038
53# CHECK-NEXT: warning: parsing line table prologue at offset 0x0000005b: unsupported version 1
54# CHECK-NEXT: warning: last sequence in debug line table at offset 0x00000061 is not terminated
55# CHECK:      error: undefined symbol: zed6a
56# CHECK-NEXT: >>> referenced by undef-bad-debug.s:11 (dir{{/|\\}}undef-bad-debug.s:11)
57# CHECK-NEXT: >>>               {{.*}}4.o:(.text+0x0)
58# CHECK:      error: undefined symbol: zed6b
59# CHECK-NEXT: >>> referenced by undef-bad-debug.s:21 (dir{{/|\\}}undef-bad-debug.s:21)
60# CHECK-NEXT: >>>               {{.*}}4.o:(.text+0x8)
61
62# Show that a problem in a line table that prevents further parsing of that
63# table means that no line information is displayed in the wardning.
64# CHECK:      error: undefined symbol: zed7
65# CHECK-NEXT: >>> referenced by {{.*}}4.o:(.text+0x10)
66
67# Show that a problem with one line table's information doesn't affect getting information from
68# a different one in the same object.
69# CHECK:      error: undefined symbol: zed8
70# CHECK-NEXT: >>> referenced by undef-bad-debug2.s:11 (dir2{{/|\\}}undef-bad-debug2.s:11)
71# CHECK-NEXT: >>>               {{.*}}tmp4.o:(.text+0x18)
72
73# RUN: not ld.lld %t.o %t2.a -o /dev/null -no-demangle 2>&1 | \
74# RUN:   FileCheck -check-prefix=NO-DEMANGLE %s
75# NO-DEMANGLE: error: undefined symbol: _Z3fooi
76
77.file "undef.s"
78
79  .globl _start
80_start:
81  call foo
82  call bar
83  call zed1
84  call _Z3fooi
85  call _ZTV3Foo
86  call __Z3fooi
87