1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/MC/ARM/not-armv4.s
Renato Golin 5e4f70ea56 [ARM] ARM mov InstAlias for MOVW lacks HasV6T2
The movw instruction is only available in ARM state for V6T2 and above.
The MOVi16 instruction has requirement HasV6T2 but the InstAlias
for mov rd, imm where the operand is imm0_65535_expr:$imm does not.

This means that movw can incorrectly be used in ARMv4 and ARMv5 by
writing mov rd, 0x1234. The simple fix is to the requirement HasV6T2
to the InstAlias. Tests added to not-armv4.s.

Patch by Peter Smith.

llvm-svn: 269761
2016-05-17 13:05:28 +00:00

14 lines
338 B
ArmAsm

@ RUN: not llvm-mc < %s -triple armv4-unknown-unknown -show-encoding 2>&1 | FileCheck %s
@ PR18524
@ CHECK: error: instruction requires: armv5t
clz r4,r9
@ CHECK: error: instruction requires: armv6t2
rbit r4,r9
@ CHECK: error: instruction requires: armv6t2
movw r4,#0x1234
@ CHECK: error: instruction requires: armv6t2
mov r4,#0x1234