OLD | NEW |
1 # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \ | 1 # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \ |
2 # RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s | 2 # RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s |
| 3 # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \ |
| 4 # RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s |
3 | 5 |
4 # Test that long nops are generated for padding where possible. | 6 # Test that long nops are generated for padding where possible. |
5 | 7 |
6 .text | 8 .text |
7 foo: | 9 foo: |
8 .bundle_align_mode 5 | 10 .bundle_align_mode 5 |
9 | 11 |
10 # This callq instruction is 5 bytes long | 12 # This callq instruction is 5 bytes long |
11 .bundle_lock align_to_end | 13 .bundle_lock align_to_end |
12 callq bar | 14 callq bar |
13 .bundle_unlock | 15 .bundle_unlock |
14 # To align this group to a bundle end, we need a 15-byte NOP and a 12-byte NOP. | 16 # To align this group to a bundle end, we need a 15-byte NOP and a 12-byte NOP. |
15 # CHECK: 0: nop | 17 # CHECK: 0: nop |
16 # CHECK-NEXT: f: nop | 18 # CHECK-NEXT: f: nop |
17 # CHECK: 1b: callq | 19 # CHECK: 1b: callq |
18 | 20 |
19 # This push instruction is 1 byte long | 21 # This push instruction is 1 byte long |
20 .bundle_lock align_to_end | 22 .bundle_lock align_to_end |
21 push %rax | 23 push %rax |
22 .bundle_unlock | 24 .bundle_unlock |
23 # To align this group to a bundle end, we need two 15-byte NOPs, and a 1-byte. | 25 # To align this group to a bundle end, we need two 15-byte NOPs, and a 1-byte. |
24 # CHECK: 20: nop | 26 # CHECK: 20: nop |
25 # CHECK-NEXT: 2f: nop | 27 # CHECK-NEXT: 2f: nop |
26 # CHECK-NEXT: 3e: nop | 28 # CHECK-NEXT: 3e: nop |
27 # CHECK-NEXT: 3f: pushq | 29 # CHECK-NEXT: 3f: pushq |
OLD | NEW |