summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/ARM/arm_fixups.s
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2014-04-18 23:06:39 +0000
committerKevin Enderby <enderby@apple.com>2014-04-18 23:06:39 +0000
commitb7e51f6af51d77abf3e7da8f5b35d023f42ef5ff (patch)
tree995b860969074b3308b4d185da71ac424a46c96a /llvm/test/MC/ARM/arm_fixups.s
parent6bdea86cabdbd880a3adbd9328d1371af2e91035 (diff)
downloadbcm5719-llvm-b7e51f6af51d77abf3e7da8f5b35d023f42ef5ff.tar.gz
bcm5719-llvm-b7e51f6af51d77abf3e7da8f5b35d023f42ef5ff.zip
Change the ARM assembler to require a :lower16: or :upper16 on non-constant
expressions for mov instructions instead of silently truncating by default. For the ARM assembler, we want to avoid misleadingly allowing something like "mov r0, <symbol>" especially when we turn it into a movw and the expression <symbol> does not have a :lower16: or :upper16" as part of the expression. We don't want the behavior of silently truncating, which can be unexpected and lead to bugs that are difficult to find since this is an easy mistake to make. This does change the previous behavior of llvm but actually matches an older gnu assembler that would not allow this but print less useful errors of like “invalid constant (0x927c0) after fixup” and “unsupported relocation on symbol foo”. The error for llvm is "immediate expression for mov requires :lower16: or :upper16" with correct location information on the operand as shown in the added test cases. rdar://12342160 llvm-svn: 206669
Diffstat (limited to 'llvm/test/MC/ARM/arm_fixups.s')
-rw-r--r--llvm/test/MC/ARM/arm_fixups.s6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/MC/ARM/arm_fixups.s b/llvm/test/MC/ARM/arm_fixups.s
index bd6906bae77..1f56e128524 100644
--- a/llvm/test/MC/ARM/arm_fixups.s
+++ b/llvm/test/MC/ARM/arm_fixups.s
@@ -26,9 +26,9 @@
@ CHECK-BE: movt r9, :upper16:_foo @ encoding: [0xe3,0b0100AAAA,0x90'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _foo, kind: fixup_arm_movt_hi16
- mov r2, fred
+ mov r2, :lower16:fred
-@ CHECK: movw r2, fred @ encoding: [A,0x20'A',0b0000AAAA,0xe3]
+@ CHECK: movw r2, :lower16:fred @ encoding: [A,0x20'A',0b0000AAAA,0xe3]
@ CHECK: @ fixup A - offset: 0, value: fred, kind: fixup_arm_movw_lo16
-@ CHECK-BE: movw r2, fred @ encoding: [0xe3,0b0000AAAA,0x20'A',A]
+@ CHECK-BE: movw r2, :lower16:fred @ encoding: [0xe3,0b0000AAAA,0x20'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: fred, kind: fixup_arm_movw_lo16
OpenPOWER on IntegriCloud