llvm-6502/test/MC/Mips/nacl-mask.s
Sasa Stankovic 068a8c145a [mips] Implement NaCl sandboxing of indirect jumps:
* Align targets of indirect jumps to instruction bundle boundaries (in MI layer).
  * Add masking instructions before indirect jumps (in MC layer).

Differential Revision: http://llvm-reviews.chandlerc.com/D2847


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202479 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28 10:00:38 +00:00

29 lines
614 B
ArmAsm

# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-nacl %s \
# RUN: | llvm-objdump -triple mipsel -disassemble -no-show-raw-insn - \
# RUN: | FileCheck %s
# This test tests that address-masking sandboxing is added when given assembly
# input.
test1:
.set noreorder
jr $a0
nop
jr $ra
nop
# CHECK-LABEL: test1:
# CHECK: and $4, $4, $14
# CHECK-NEXT: jr $4
# Check that additional nop is inserted, to align mask and jr to the next
# bundle.
# CHECK-NEXT: nop
# CHECK-NEXT: nop
# CHECK: and $ra, $ra, $14
# CHECK-NEXT: jr $ra