[PATCH] D91678: Symbolizer test for Basic block sections
Sriraman Tallam via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 17 20:19:49 PST 2020
tmsriram updated this revision to Diff 305964.
tmsriram added a comment.
Update the line numbers after adding comments.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91678/new/
https://reviews.llvm.org/D91678
Files:
llvm/test/DebugInfo/Inputs/llvm-symbolizer-bbsections-test.c
llvm/test/DebugInfo/Inputs/llvm-symbolizer-bbsections-test.elf-x86-64
llvm/test/DebugInfo/symbolize-bbsections.test
Index: llvm/test/DebugInfo/symbolize-bbsections.test
===================================================================
--- /dev/null
+++ llvm/test/DebugInfo/symbolize-bbsections.test
@@ -0,0 +1,10 @@
+RUN: llvm-symbolizer --obj=%p/Inputs/llvm-symbolizer-bbsections-test.elf-x86-64 0x201740 0x201750 0x201760 0x2017bf| FileCheck %s
+
+CHECK: main
+CHECK-NEXT: llvm-symbolizer-bbsections-test.c:34
+CHECK: g
+CHECK-NEXT: llvm-symbolizer-bbsections-test.c:20
+CHECK: main
+CHECK-NEXT: llvm-symbolizer-bbsections-test.c:29
+CHECK: main
+CHECK-NEXT: llvm-symbolizer-bbsections-test.c:33
Index: llvm/test/DebugInfo/Inputs/llvm-symbolizer-bbsections-test.c
===================================================================
--- /dev/null
+++ llvm/test/DebugInfo/Inputs/llvm-symbolizer-bbsections-test.c
@@ -0,0 +1,37 @@
+// This is used to generate llvm-symbolizer-bbsections-test.elf-x86-64.
+// $ cat > syms.txt
+// main.4
+// g
+// main
+// f
+// main.1
+// h
+// main.3
+// _start
+// main.2
+// $
+// $ clang -fbasic-block-sections=all llvm-symbolizer-bbsections-test.c \
+// -fuse-ld=lld -Wl,--symbol-ordering-file,syms.txt
+
+int f(int a) {
+ return a + 1;
+}
+
+int g(int a) {
+ return a + 2;
+}
+
+int h(int a) {
+ return a + 3;
+}
+
+// Use simple control flow to generate lots of basic block sections.
+int main(int argc, char *argv[]) {
+ if (argc > 10)
+ return f(argc);
+ else if (argc > 8)
+ return g(argc);
+ else if (argc > 4)
+ return h(argc);
+ return 0;
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91678.305964.patch
Type: text/x-patch
Size: 1511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201118/4847402d/attachment.bin>
More information about the llvm-commits
mailing list