[lld] r339514 - [LLD][ELF] - Add one more test case for CallGraphSort.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 12 02:16:22 PDT 2018


Author: grimar
Date: Sun Aug 12 02:16:22 2018
New Revision: 339514

URL: http://llvm.org/viewvc/llvm-project?rev=339514&view=rev
Log:
[LLD][ELF] - Add one more test case for CallGraphSort.

This adds a coverage for the following early continue:
https://github.com/llvm-mirror/lld/blob/master/ELF/CallGraphSort.cpp#L200

Added:
    lld/trunk/test/ELF/cgprofile-txt2.s

Added: lld/trunk/test/ELF/cgprofile-txt2.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/cgprofile-txt2.s?rev=339514&view=auto
==============================================================================
--- lld/trunk/test/ELF/cgprofile-txt2.s (added)
+++ lld/trunk/test/ELF/cgprofile-txt2.s Sun Aug 12 02:16:22 2018
@@ -0,0 +1,38 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+# RUN: echo "A B 5" > %t.call_graph
+# RUN: echo "B C 50" >> %t.call_graph
+# RUN: echo "C D 40" >> %t.call_graph
+# RUN: echo "D B 10" >> %t.call_graph
+# RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph -o %t2
+# RUN: llvm-readobj -symbols %t2 | FileCheck %s
+
+# CHECK:      Name: A
+# CHECK-NEXT: Value: 0x201003
+# CHECK:      Name: B
+# CHECK-NEXT: Value: 0x201000
+# CHECK:      Name: C
+# CHECK-NEXT: Value: 0x201001
+# CHECK:      Name: D
+# CHECK-NEXT: Value: 0x201002
+
+.section    .text.A,"ax", at progbits
+.globl  A
+A:
+ nop
+
+.section    .text.B,"ax", at progbits
+.globl  B
+B:
+ nop
+
+.section    .text.C,"ax", at progbits
+.globl  C
+C:
+ nop
+
+.section    .text.D,"ax", at progbits
+.globl  D
+D:
+ nop




More information about the llvm-commits mailing list