OLD | NEW |
(Empty) | |
| 1 # RUN: llvm-mc -filetype=obj -triple i686-unknown-nacl %s -o - \ |
| 2 # RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s |
| 3 |
| 4 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-nacl \ |
| 5 # RUN: -sfi-hide-sandbox-base=false %s -o - \ |
| 6 # RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s |
| 7 |
| 8 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-nacl \ |
| 9 # RUN: -sfi-hide-sandbox-base=true %s -o - \ |
| 10 # RUN: | llvm-objdump -disassemble -no-show-raw-insn - \ |
| 11 # RUN: | FileCheck --check-prefix=HIDE %s |
| 12 |
| 13 # Test that bare call instructions in NaCl are automatically aligned to the end |
| 14 # of a bundle without the need for .bundle_align directives, to match gas's |
| 15 # behavior. |
| 16 .text |
| 17 foo: |
| 18 # Each of these mov instructions is 4 bytes long. |
| 19 movsd %xmm1,%xmm2 |
| 20 movsd %xmm1,%xmm2 |
| 21 movsd %xmm1,%xmm2 |
| 22 movsd %xmm1,%xmm2 |
| 23 # Each of these movs is 5 bytes long. |
| 24 movl $1, %eax |
| 25 movl $1, %eax |
| 26 call bar |
| 27 # To align this call to a bundle end, we need a 1-byte NOP. |
| 28 # CHECK: 1a: nop |
| 29 # CHECK-NEXT: 1b: call |
| 30 |
| 31 movsd %xmm1,%xmm2 |
| 32 movsd %xmm1,%xmm2 |
| 33 movsd %xmm1,%xmm2 |
| 34 movsd %xmm1,%xmm2 |
| 35 movl $1, %eax |
| 36 movl $1, %eax |
| 37 movl $1, %eax |
| 38 call bar |
| 39 # Here we have to pad until the end of the *next* boundary because |
| 40 # otherwise the call crosses a boundary. |
| 41 # The last byte of the bundle has to be a 1-byte nop so it doesn't |
| 42 # cross the boundary itself. |
| 43 # CHECK: 3f: nop |
| 44 # The remaining nops can be implemented any way the compiler wants. |
| 45 # CHECK: 5b: call |
| 46 |
| 47 # HIDE-NOT: call |
OLD | NEW |