File: disassemble-zeroes.s

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (79 lines) | stat: -rw-r--r-- 3,162 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t
// RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=NODISASM

// The exact rules of skipping the bytes you can find in the code.
// This test checks that we follow these rules and can force
// dissasembly of zero blocks with the -z and --disassemble-zeroes options.

// NODISASM:       0000000000000000 <main>:
// NODISASM-NEXT:   0:  00 00               addb %al, (%rax)
// NODISASM-NEXT:   2:  00 00               addb %al, (%rax)
// NODISASM-NEXT:   4:  00 00               addb %al, (%rax)
// NODISASM-NEXT:   6:  00 90 00 00 00 00   addb %dl, (%rax)
// NODISASM-NEXT:       ...
// NODISASM-NEXT:   20: 90                  nop
// NODISASM-NEXT:       ...
// NODISASM:      0000000000000031 <foo>:
// NODISASM-NEXT:   31: 00 00               addb %al, (%rax)
// NODISASM-NEXT:   33: 00 00               addb %al, (%rax)
// NODISASM:      0000000000000035 <bar>:
// NODISASM-NEXT:       ...

// Check that with -z we disassemble blocks of zeroes.
// RUN: llvm-objdump -d -z %t | FileCheck %s --check-prefix=DISASM

// DISASM:      0000000000000000 <main>:
// DISASM-NEXT:   0: 00 00              addb %al, (%rax)
// DISASM-NEXT:   2: 00 00              addb %al, (%rax)
// DISASM-NEXT:   4: 00 00              addb %al, (%rax)
// DISASM-NEXT:   6: 00 90 00 00 00 00  addb %dl, (%rax)
// DISASM-NEXT:   c: 00 00              addb %al, (%rax)
// DISASM-NEXT:   e: 00 00              addb %al, (%rax)
// DISASM-NEXT:  10: 00 00              addb %al, (%rax)
// DISASM-NEXT:  12: 00 00              addb %al, (%rax)
// DISASM-NEXT:  14: 00 00              addb %al, (%rax)
// DISASM-NEXT:  16: 00 00              addb %al, (%rax)
// DISASM-NEXT:  18: 00 00              addb %al, (%rax)
// DISASM-NEXT:  1a: 00 00              addb %al, (%rax)
// DISASM-NEXT:  1c: 00 00              addb %al, (%rax)
// DISASM-NEXT:  1e: 00 00              addb %al, (%rax)
// DISASM-NEXT:  20: 90                 nop
// DISASM-NEXT:  21: 00 00              addb %al, (%rax)
// DISASM-NEXT:  23: 00 00              addb %al, (%rax)
// DISASM-NEXT:  25: 00 00              addb %al, (%rax)
// DISASM-NEXT:  27: 00 00              addb %al, (%rax)
// DISASM-NEXT:  29: 00 00              addb %al, (%rax)
// DISASM-NEXT:  2b: 00 00              addb %al, (%rax)
// DISASM-NEXT:  2d: 00 00              addb %al, (%rax)
// DISASM-NEXT:  2f: 00 00              addb %al, (%rax)
// DISASM:      0000000000000031 <foo>:
// DISASM-NEXT:  31: 00 00              addb %al, (%rax)
// DISASM-NEXT:  33: 00 00              addb %al, (%rax)
// DISASM:      0000000000000035 <bar>:
// DISASM-NEXT:  35: 00 00              addb %al, (%rax)
// DISASM-NEXT:  37: 00 00              addb %al, (%rax)
// DISASM-NEXT:  39: 00 00              addb %al, (%rax)
// DISASM-NEXT:  3b: 00 00              addb %al, (%rax)

// Check that --disassemble-zeroes work as alias for -z.
// RUN: llvm-objdump -d --disassemble-zeroes %t | FileCheck %s --check-prefix=DISASM

.text
.globl main
.type main, @function
main:
 .long 0
 .byte 0
 .byte 0
 .byte 0
 nop
 .quad 0
 .quad 0
 .quad 0
 nop
 .quad 0
 .quad 0
foo:
 .long 0
bar:
 .quad 0