[llvm-symbolizer] improve test and fix doc example after recent --print-source-contex...
authorBen Dunbobbin <Ben.Dunbobbin@sony.com>
Fri, 11 Jun 2021 12:35:04 +0000 (13:35 +0100)
committerBen Dunbobbin <Ben.Dunbobbin@sony.com>
Wed, 16 Jun 2021 12:38:22 +0000 (13:38 +0100)
I believe that after https://reviews.llvm.org/D102355 the behaviour of --print-source-context-lines has changed.

Before: --print-source-context-lines=3 prints 4 lines.
After: --print-source-context-lines=3 prints 3 lines.

Adjust the example in the docs for this change and make the testing a little more robust.

Differential Revision: https://reviews.llvm.org/D104114

llvm/docs/CommandGuide/llvm-symbolizer.rst
llvm/test/tools/llvm-symbolizer/print_context.c

index 0a0ad16..e64211d 100644 (file)
@@ -359,7 +359,7 @@ OPTIONS
 
   .. code-block:: console
 
-    $ llvm-symbolizer --obj=test.elf 0x400490 --print-source-context-lines=2
+    $ llvm-symbolizer --obj=test.elf 0x400490 --print-source-context-lines=3
     baz()
     /tmp/test.cpp:11:0
     10  :   volatile int k = 42;
index 5b80054..94a1108 100644 (file)
@@ -20,9 +20,10 @@ int main() {
 // location independent.
 
 // CHECK: inc
-// CHECK: print_context.c:3
-// CHECK: 1  : #include
-// CHECK: 2  :
-// CHECK: 3 >: int inc
-// CHECK: 4  :   return
-// CHECK: 5  : }
+// CHECK-NEXT: print_context.c:3
+// CHECK-NEXT: 1  : #include
+// CHECK-NEXT: 2  :
+// CHECK-NEXT: 3 >: int inc
+// CHECK-NEXT: 4  :   return
+// CHECK-NEXT: 5  : }
+// CHECK-NOT:  6