mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
0492ef49dc
Summary: GNU objdump prints the method name in disassembly output, and upon further investigation this seems to come from debug info, not the symbol table. Some additional refactoring is necessary to make this work even when the line number is 0/the filename is unknown. The added test case includes a note for this scenario. See http://llvm.org/PR41341 for more info. Reviewers: dblaikie, MaskRay, jhenderson Reviewed By: MaskRay Subscribers: ormris, jvesely, aprantl, kerbowa, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74507
35 lines
944 B
Plaintext
35 lines
944 B
Plaintext
; RUN: llvm-objdump -disassemble -line-numbers %p/Inputs/embedded-source | FileCheck --check-prefix=LINE %s
|
|
; RUN: llvm-objdump -disassemble -source %p/Inputs/embedded-source | FileCheck --check-prefix=SOURCE %s
|
|
; REQUIRES: x86-registered-target
|
|
|
|
; Source for embedded-source.c
|
|
; To regenerate this file:
|
|
; clang -gdwarf-5 -gembed-source embedded-source.c -o embedded-source
|
|
;
|
|
; int main(int argc, char *argv[]) {
|
|
; int i = 2;
|
|
; i += 1;
|
|
; return i;
|
|
; }
|
|
|
|
; LINE: main:
|
|
; LINE-NEXT: ; main():
|
|
; LINE-NEXT: ; {{.*}}embedded-source.c:1
|
|
; LINE-NEXT: pushq %rbp
|
|
; LINE: ; {{.*}}embedded-source.c:2
|
|
; LINE-NEXT: movl $2
|
|
; LINE: ; {{.*}}embedded-source.c:3
|
|
; LINE: addl $1
|
|
; LINE: ; {{.*}}embedded-source.c:4
|
|
; LINE: retq
|
|
|
|
; SOURCE: main:
|
|
; SOURCE-NEXT: ; int main(int argc, char *argv[]) {
|
|
; SOURCE-NEXT: pushq %rbp
|
|
; SOURCE: ; int i = 2;
|
|
; SOURCE-NEXT: movl $2
|
|
; SOURCE: ; i += 1;
|
|
; SOURCE: addl $1
|
|
; SOURCE: ; return i;
|
|
; SOURCE: retq
|