1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/test/tools/llvm-objdump/embedded-source.test
Fangrui Song 25a0241f66 [llvm-objdump] -d: print 00000000 <foo>: instead of 00000000 foo:
The new behavior matches GNU objdump. A pair of angle brackets makes tests slightly easier.

`.foo:` is not unique and thus cannot be used in a `CHECK-LABEL:` directive.
Without `-LABEL`, the CHECK line can match the `Disassembly of section`
line and causes the next `CHECK-NEXT:` to fail.

```
Disassembly of section .foo:

0000000000001634 .foo:
```

Bdragon: <> has metalinguistic connotation. it just "feels right"

Reviewed By: rupprecht

Differential Revision: https://reviews.llvm.org/D75713
2020-03-05 18:05:28 -08:00

35 lines
948 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