[PATCH] D72092: [test][ELF] Use CHECK-NEXT to properly check error messages
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 2 09:40:07 PST 2020
jhenderson created this revision.
jhenderson added reviewers: MaskRay, grimar.
Herald added a subscriber: emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
This is a follow up to D71759 <https://reviews.llvm.org/D71759>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72092
Files:
lld/test/ELF/undef.s
Index: lld/test/ELF/undef.s
===================================================================
--- lld/test/ELF/undef.s
+++ lld/test/ELF/undef.s
@@ -10,57 +10,59 @@
# RUN: not ld.lld -pie %t.o %t2.a %t3.o %t4.o -o %t.exe 2>&1 \
# RUN: | FileCheck %s --implicit-check-not="error:" --implicit-check-not="warning:"
-# CHECK: error: undefined symbol: foo
-# CHECK: >>> referenced by undef.s
-# CHECK: {{.*}}:(.text+0x1)
+# CHECK: error: undefined symbol: foo
+# CHECK-NEXT: >>> referenced by undef.s
+# CHECK-NEXT: {{.*}}:(.text+0x1)
-# CHECK: error: undefined symbol: bar
-# CHECK: >>> referenced by undef.s
-# CHECK: >>> {{.*}}:(.text+0x6)
+# CHECK: error: undefined symbol: bar
+# CHECK-NEXT: >>> referenced by undef.s
+# CHECK-NEXT: >>> {{.*}}:(.text+0x6)
-# CHECK: error: undefined symbol: foo(int)
-# CHECK: >>> referenced by undef.s
-# CHECK: >>> {{.*}}:(.text+0x10)
+# CHECK: error: undefined symbol: foo(int)
+# CHECK-NEXT: >>> referenced by undef.s
+# CHECK-NEXT: >>> {{.*}}:(.text+0x10)
-# CHECK: error: undefined symbol: vtable for Foo
-# CHECK: the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
+# CHECK: error: undefined symbol: vtable for Foo
+# CHECK-NEXT: >>> referenced by undef.s
+# CHECK-NEXT: >>> {{.*}}:(.text+0x15)
+# CHECK-NEXT: the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
# Check that this symbol isn't demangled
-# CHECK: error: undefined symbol: __Z3fooi
-# CHECK: >>> referenced by undef.s
-# CHECK: >>> {{.*}}:(.text+0x1A)
+# CHECK: error: undefined symbol: __Z3fooi
+# CHECK-NEXT: >>> referenced by undef.s
+# CHECK-NEXT: >>> {{.*}}:(.text+0x1A)
-# CHECK: error: undefined symbol: zed2
-# CHECK: >>> referenced by {{.*}}.o:(.text+0x0) in archive {{.*}}2.a
+# CHECK: error: undefined symbol: zed2
+# CHECK-NEXT: >>> referenced by {{.*}}.o:(.text+0x0) in archive {{.*}}2.a
-# CHECK: error: undefined symbol: zed3
-# CHECK: >>> referenced by undef-debug.s:3 (dir{{/|\\}}undef-debug.s:3)
-# CHECK: >>> {{.*}}.o:(.text+0x0)
+# CHECK: error: undefined symbol: zed3
+# CHECK-NEXT: >>> referenced by undef-debug.s:3 (dir{{/|\\}}undef-debug.s:3)
+# CHECK-NEXT: >>> {{.*}}.o:(.text+0x0)
-# CHECK: error: undefined symbol: zed4
-# CHECK: >>> referenced by undef-debug.s:7 (dir{{/|\\}}undef-debug.s:7)
-# CHECK: >>> {{.*}}.o:(.text.1+0x0)
+# CHECK: error: undefined symbol: zed4
+# CHECK-NEXT: >>> referenced by undef-debug.s:7 (dir{{/|\\}}undef-debug.s:7)
+# CHECK-NEXT: >>> {{.*}}.o:(.text.1+0x0)
-# CHECK: error: undefined symbol: zed5
-# CHECK: >>> referenced by undef-debug.s:11 (dir{{/|\\}}undef-debug.s:11)
-# CHECK: >>> {{.*}}.o:(.text.2+0x0)
+# CHECK: error: undefined symbol: zed5
+# CHECK-NEXT: >>> referenced by undef-debug.s:11 (dir{{/|\\}}undef-debug.s:11)
+# CHECK-NEXT: >>> {{.*}}.o:(.text.2+0x0)
# Show that all line table problems are mentioned as soon as the object's line information
# is requested, even if that particular part of the line information is not currently required.
# Also show that the warnings are only printed once.
-# CHECK: warning: parsing line table prologue at 0x00000000 should have ended at 0x00000038 but it ended at 0x00000037
-# CHECK: warning: last sequence in debug line table is not terminated!
-# CHECK: error: undefined symbol: zed6a
-# CHECK: >>> referenced by {{.*}}tmp4.o:(.text+0x0)
-# CHECK: error: undefined symbol: zed6b
-# CHECK: >>> referenced by {{.*}}tmp4.o:(.text+0x8)
+# CHECK: warning: parsing line table prologue at 0x00000000 should have ended at 0x00000038 but it ended at 0x00000037
+# CHECK-NEXT: warning: last sequence in debug line table is not terminated!
+# CHECK: error: undefined symbol: zed6a
+# CHECK-NEXT: >>> referenced by {{.*}}tmp4.o:(.text+0x0)
+# CHECK: error: undefined symbol: zed6b
+# CHECK-NEXT: >>> referenced by {{.*}}tmp4.o:(.text+0x8)
# Show that a problem with one line table's information doesn't affect getting information from
# a different one in the same object.
-# CHECK: error: undefined symbol: zed7
-# CHECK: >>> referenced by undef-bad-debug2.s:11 (dir2{{/|\\}}undef-bad-debug2.s:11)
-# CHECK: >>> {{.*}}tmp4.o:(.text+0x10)
+# CHECK: error: undefined symbol: zed7
+# CHECK-NEXT: >>> referenced by undef-bad-debug2.s:11 (dir2{{/|\\}}undef-bad-debug2.s:11)
+# CHECK-NEXT: >>> {{.*}}tmp4.o:(.text+0x10)
# RUN: not ld.lld %t.o %t2.a -o %t.exe -no-demangle 2>&1 | \
# RUN: FileCheck -check-prefix=NO-DEMANGLE %s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72092.235897.patch
Type: text/x-patch
Size: 4837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200102/1b9d1dae/attachment.bin>
More information about the llvm-commits
mailing list