summaryrefslogtreecommitdiffstats
path: root/test/MC/Mips/mips1
diff options
context:
space:
mode:
authorSimon Dardis <simon.dardis@imgtec.com>2016-05-27 13:56:36 +0000
committerSimon Dardis <simon.dardis@imgtec.com>2016-05-27 13:56:36 +0000
commitbba655e896f2826511967e55b2ee859749b247ad (patch)
treeeb403849a838c43528652cabdd747dafda32cd2c /test/MC/Mips/mips1
parentceb0f307b3ac11aad61242d75215db1234b4b3b7 (diff)
[mips] Weaken asm predicate for memory offsets
The isMemWithSimmOffset predicate rejects relocations which is incorrect behaviour. Linkers and other tools should handle|warn|error when the field overflows. Reviewers: dsanders, vkalintiris Differential Revision: http://reviews.llvm.org/D20727 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270995 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/Mips/mips1')
-rw-r--r--test/MC/Mips/mips1/valid.s21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/MC/Mips/mips1/valid.s b/test/MC/Mips/mips1/valid.s
index 702e39911496..6c49dc51e435 100644
--- a/test/MC/Mips/mips1/valid.s
+++ b/test/MC/Mips/mips1/valid.s
@@ -152,3 +152,24 @@ a:
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
1:
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ .type g_8,@object
+ .comm g_8,16,16