]> oss.titaniummirror.com Git - msp430-binutils.git/blobdiff - gas/testsuite/gas/mips/elf-rel8-mips16.s
Imported binutils-2.20
[msp430-binutils.git] / gas / testsuite / gas / mips / elf-rel8-mips16.s
diff --git a/gas/testsuite/gas/mips/elf-rel8-mips16.s b/gas/testsuite/gas/mips/elf-rel8-mips16.s
new file mode 100644 (file)
index 0000000..0c9eefe
--- /dev/null
@@ -0,0 +1,39 @@
+       .equ    $fprel, 2
+       .set    mips16
+
+       .ent    foo
+foo:
+       move    $2,$gp
+
+       # Test various forms of relocation syntax.
+
+       li      $4,(%hi gvar)
+       sll     $4,16
+       addiu   $4,(%lo (gvar))
+       lw      $4,%lo gvar($5)
+
+       # Check that registers aren't confused with $ identifiers.
+
+       lw      $4,($fprel)($17)
+
+       # Check various forms of paired relocations.
+
+       lw      $4,%got(lvar)($2)
+       sb      $5,%lo(lvar)($4)
+
+       lw      $4,%got(lvar)($2)
+       addiu   $4,%lo(lvar)
+
+       # Check individual relocations.
+
+       lw      $3,%call16(gfunc)($2)
+       addiu   $4,%call16(gfunc)
+
+       lw      $4,%gprel(gvar)($2)
+       sw      $4,%gprel(gvar)($2)
+       addiu   $4,%gprel(gvar)
+       .align  6
+       .end    foo
+
+       .data
+lvar:  .word   1,2