diff options
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/cris/rd-tls-1.d | 28 | ||||
-rw-r--r-- | gas/testsuite/gas/cris/rd-tls-1.s | 16 | ||||
-rw-r--r-- | gas/testsuite/gas/cris/rd-tls-2.d | 48 | ||||
-rw-r--r-- | gas/testsuite/gas/cris/rd-tls-2.s | 26 | ||||
-rw-r--r-- | gas/testsuite/gas/cris/tls-err-1.s | 16 | ||||
-rw-r--r-- | gas/testsuite/gas/cris/tls-err-2.s | 19 | ||||
-rw-r--r-- | gas/testsuite/gas/cris/tls-err-3.s | 14 |
8 files changed, 173 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 4ecad56..ff9c7d0 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-10-04 Hans-Peter Nilsson <hp@axis.com> + + * gas/cris/rd-tls-1.s, gas/cris/rd-tls-1.d, gas/cris/rd-tls-2.s, + gas/cris/rd-tls-2.d, gas/cris/tls-err-1.s, gas/cris/tls-err-2.s, + gas/cris/tls-err-3.s: New tests. + 2008-09-26 Andreas Krebbel <krebbel1@de.ibm.com> * gas/s390/esa-g5.d: Adjust according to the s390-opc changes. diff --git a/gas/testsuite/gas/cris/rd-tls-1.d b/gas/testsuite/gas/cris/rd-tls-1.d new file mode 100644 index 0000000..db2c8f9 --- /dev/null +++ b/gas/testsuite/gas/cris/rd-tls-1.d @@ -0,0 +1,28 @@ +#objdump: -dr +#as: --em=criself +#name: TLS non-PIC relocs. + +.*: file format .*-cris + +Disassembly of section \.text: + +0+ <start>: +[ ]+0:[ ]+af1e 0000 0000[ ]+sub\.d 0 <start>,\$?r1 +[ ]+2:[ ]+R_CRIS_32_GD \.text +[ ]+6:[ ]+2f9e 0000 0000[ ]+add\.d 0 <start>,\$?r9 +[ ]+8:[ ]+R_CRIS_32_GD extsym2 +[ ]+c:[ ]+6f3d 0000 0000 6aaa[ ]+move\.d \[\$?r3\+0 <start>\],\$?r10 +[ ]+e:[ ]+R_CRIS_32_TPREL extsym +[ ]+14:[ ]+5fae 0000[ ]+move\.w 0x0,\$?r10 +[ ]+16:[ ]+R_CRIS_16_TPREL extsym14\+0x4d +[ ]+18:[ ]+af9e 0000 0000[ ]+sub\.d 0 <start>,\$?r9 +[ ]+1a:[ ]+R_CRIS_32_GD extsym4\+0x2a +[ ]+1e:[ ]+af3e 0000 0000[ ]+sub\.d 0 <start>,\$?r3 +[ ]+20:[ ]+R_CRIS_32_GD extsym4\+0xffffffa0 +[ ]+24:[ ]+6f3d 0000 0000 67de[ ]+move\.d \[\$?r7=\$?r3\+0 <start>\],\$?r13 +[ ]+26:[ ]+R_CRIS_32_GD extsym10\+0xfffffeb6 +[ ]+2c:[ ]+5fbd 0000 699a[ ]+move\.d \[\$?r11\+0\],\$?r9 +[ ]+2e:[ ]+R_CRIS_16_TPREL extsym14\+0xffffff00 +[ ]+32:[ ]+6fad 0000 0000 287a[ ]+add\.d \[\$?r10\+0 <start>\],\$?r7,\$?r8 +[ ]+34:[ ]+R_CRIS_32_TPREL extsym3\+0x38 +[ ]+\.\.\. diff --git a/gas/testsuite/gas/cris/rd-tls-1.s b/gas/testsuite/gas/cris/rd-tls-1.s new file mode 100644 index 0000000..05bbefa --- /dev/null +++ b/gas/testsuite/gas/cris/rd-tls-1.s @@ -0,0 +1,16 @@ +; Check that non-PIC TLS operands get their right relocation type. +; First some expected uses, similar to what GCC will emit. + .text + .syntax no_register_prefix +start: + sub.d .:GD,r1 + add.d extsym2:GD,r9 + move.d [r3+extsym:TPOFF],r10 + move.w extsym14:TPOFF16+77,r10 + +; Other for GAS valid operands (some with questionable PIC semantics). + sub.d extsym4:GD+42,r9 + sub.d extsym4:GD-96,r3 + move.d [r7=r3+extsym10:GD-330],r13 + move.d [r11+extsym14:TPOFF16-256],r9 + add.d [r10+extsym3:TPOFF+56],r7,r8 diff --git a/gas/testsuite/gas/cris/rd-tls-2.d b/gas/testsuite/gas/cris/rd-tls-2.d new file mode 100644 index 0000000..a5f8647 --- /dev/null +++ b/gas/testsuite/gas/cris/rd-tls-2.d @@ -0,0 +1,48 @@ +#objdump: -dr +#as: --em=criself --pic +#name: TLS PIC relocs. + +.*: file format .*-cris + +Disassembly of section \.text: + +0+ <start>: +[ ]+0: 6f3d 0000 0000 6aaa[ ]+move\.d \[\$?r3\+0 <start>\],\$?r10 +[ ]+2: R_CRIS_32_GOT_TPREL extsym +[ ]+8: 6f8e 0000 0000[ ]+move\.d 0 <start>,\$?r8 +[ ]+a: R_CRIS_32_GOT_TPREL extsym5 +[ ]+e: 5f8e 0000[ ]+move\.w 0x0,\$?r8 +[ ]+10: R_CRIS_16_GOT_TPREL extsym9 +[ ]+12: 6f3d 0000 0000 6aaa[ ]+move\.d \[\$?r3\+0 <start>\],\$?r10 +[ ]+14: R_CRIS_32_GOT_GD extsym +[ ]+1a: 5fdd 0000 6aaa[ ]+move\.d \[\$?r13\+0\],\$?r10 +[ ]+1c: R_CRIS_16_GOT_TPREL extsym13 +[ ]+20: 5fae 0000[ ]+move\.w 0x0,\$?r10 +[ ]+22: R_CRIS_16_GOT_GD extsym14 +[ ]+24: af9e 0000 0000[ ]+sub\.d 0 <start>,\$?r9 +[ ]+26: R_CRIS_32_DTPREL extsym4\+0x16 +[ ]+2a: 9f3e 0000[ ]+sub\.w 0x0,\$?r3 +[ ]+2c: R_CRIS_16_DTPREL extsym4\+0xffffffaa +[ ]+2e: 6f3d 0000 0000 aa4a[ ]+sub\.d \[\$?r3\+0 <start>\],\$?r4,\$?r10 +[ ]+30: R_CRIS_32_GOT_TPREL extsym3 +[ ]+36: af9e 0000 0000[ ]+sub\.d 0 <start>,\$?r9 +[ ]+38: R_CRIS_32_GOT_GD extsym4\+0x2a +[ ]+3c: af3e 0000 0000[ ]+sub\.d 0 <start>,\$?r3 +[ ]+3e: R_CRIS_32_GOT_TPREL extsym4\+0xffffffa0 +[ ]+42: 6fad 0000 0000 287a[ ]+add\.d \[\$?r10\+0 <start>\],\$?r7,\$?r8 +[ ]+44: R_CRIS_32_GOT_TPREL extsym3\+0x38 +[ ]+4a: 6f5d 0000 0000 611a[ ]+move\.d \[\$?r5\+0 <start>\],\$?r1 +[ ]+4c: R_CRIS_32_GOT_TPREL extsym6\+0xa +[ ]+52: 6fad 0000 0000 284a[ ]+add\.d \[\$?r10\+0 <start>\],\$?r4,\$?r8 +[ ]+54: R_CRIS_32_GOT_TPREL extsym3\+0xfffffdd0 +[ ]+5a: 6f5d 0000 0000 6cca[ ]+move\.d \[\$?r5\+0 <start>\],\$?r12 +[ ]+5c: R_CRIS_32_GOT_TPREL extsym6\+0xffffff92 +[ ]+62: 6f5d 0000 0000 69ce[ ]+move\.d \[\$?r9=\$?r5\+0 <start>\],\$?r12 +[ ]+64: R_CRIS_32_GOT_TPREL extsym6\+0xffffff24 +[ ]+6a: 5fcd 0000 a89a[ ]+sub\.d \[\$?r12\+0\],\$?r9,\$?r8 +[ ]+6c: R_CRIS_16_GOT_TPREL extsym3\+0xffffff64 +[ ]+70: 5fbd 0000 699a[ ]+move\.d \[\$?r11\+0\],\$?r9 +[ ]+72: R_CRIS_16_GOT_GD extsym14\+0xffffff00 +[ ]+76: 6fad 0000 0000 287a[ ]+add\.d \[\$?r10\+0 <start>\],\$?r7,\$?r8 +[ ]+78: R_CRIS_32_GOT_GD extsym3\+0x38 +[ ]+\.\.\. diff --git a/gas/testsuite/gas/cris/rd-tls-2.s b/gas/testsuite/gas/cris/rd-tls-2.s new file mode 100644 index 0000000..b1bc557 --- /dev/null +++ b/gas/testsuite/gas/cris/rd-tls-2.s @@ -0,0 +1,26 @@ +; Check that TLS PIC operands get their right relocation type. +; First some expected uses, similar to what GCC will emit. + .text + .syntax no_register_prefix +start: + move.d [r3+extsym:TPOFFGOT],r10 + move.d extsym5:TPOFFGOT,r8 + move.w extsym9:TPOFFGOT16,r8 + move.d [r3+extsym:GDGOTREL],r10 + move.d [r13+extsym13:TPOFFGOT16],r10 + move.w extsym14:GDGOTREL16,r10 + sub.d extsym4:DTPREL+22,r9 + sub.w extsym4:DTPREL16-86,r3 + +; Other for GAS valid operands (some with questionable PIC semantics). + sub.d [r3+extsym3:TPOFFGOT],r4,r10 + sub.d extsym4:GDGOTREL+42,r9 + sub.d extsym4:TPOFFGOT-96,r3 + add.d [r10+extsym3:TPOFFGOT+56],r7,r8 + move.d [r5+extsym6:TPOFFGOT+10],r1 + add.d [r10+extsym3:TPOFFGOT-560],r4,r8 + move.d [r5+extsym6:TPOFFGOT-110],r12 + move.d [r9=r5+extsym6:TPOFFGOT-220],r12 + sub.d [r12+extsym3:TPOFFGOT16-156],r9,r8 + move.d [r11+extsym14:GDGOTREL16-256],r9 + add.d [r10+extsym3:GDGOTREL+56],r7,r8 diff --git a/gas/testsuite/gas/cris/tls-err-1.s b/gas/testsuite/gas/cris/tls-err-1.s new file mode 100644 index 0000000..5a6e9cd --- /dev/null +++ b/gas/testsuite/gas/cris/tls-err-1.s @@ -0,0 +1,16 @@ +; Like pic-err-1.s but for non-pic TLS suffixes. + +; { dg-do assemble } +; { dg-options "--no-underscore --em=criself" } + + .syntax no_register_prefix + .text +start: + move.b extsym:TPOFF16,r4 ; { dg-error "TLS relocation size does not match" "" { xfail *-*-* } } + move.b extsym12:TPOFF,r5 ; { dg-error "TLS relocation size does not match" } + move.w extsym2:TPOFF,r5 ; { dg-error "TLS relocation size does not match" } + move.d extsym3:TPOFF16,r6 ; { dg-error "TLS relocation size does not match" } + move extsym4:TPOFF16,srp ; { dg-error "TLS relocation size does not match" } + move.b extsym15:GD,r7 ; { dg-error "TLS relocation size does not match" } + move.w extsym6:GD,r5 ; { dg-error "TLS relocation size does not match" } + move extsym8:TPOFF16,srp ; { dg-error "TLS relocation size does not match" } diff --git a/gas/testsuite/gas/cris/tls-err-2.s b/gas/testsuite/gas/cris/tls-err-2.s new file mode 100644 index 0000000..d320651 --- /dev/null +++ b/gas/testsuite/gas/cris/tls-err-2.s @@ -0,0 +1,19 @@ +; Like tls-err-1.s but for PIC TLS suffixes. + +; { dg-do assemble } +; { dg-options "--pic --no-underscore --em=criself" } + + .syntax no_register_prefix + .text +start: + move.b extsym:GDGOTREL16,r4 ; { dg-error "PIC relocation size does not match" "" { xfail *-*-* } } + move.b extsym12:GDGOTREL,r5 ; { dg-error "PIC relocation size does not match" } + move.w extsym2:GDGOTREL,r5 ; { dg-error "PIC relocation size does not match" } + move.d extsym3:GDGOTREL16,r6 ; { dg-error "PIC relocation size does not match" } + move extsym4:GDGOTREL16,srp ; { dg-error "PIC relocation size does not match" } + move.b extsym5:TPOFFGOT16,r4 ; { dg-error "PIC relocation size does not match" "" { xfail *-*-* } } + move.b extsym15:TPOFFGOT,r7 ; { dg-error "PIC relocation size does not match" } + move.w extsym6:DTPREL,r5 ; { dg-error "PIC relocation size does not match" } + move.d extsym7:DTPREL16,r6 ; { dg-error "PIC relocation size does not match" } + move.d extsym7:TPOFFGOT16,r6 ; { dg-error "PIC relocation size does not match" } + move extsym8:TPOFFGOT16,srp ; { dg-error "PIC relocation size does not match" } diff --git a/gas/testsuite/gas/cris/tls-err-3.s b/gas/testsuite/gas/cris/tls-err-3.s new file mode 100644 index 0000000..cbc2b5d --- /dev/null +++ b/gas/testsuite/gas/cris/tls-err-3.s @@ -0,0 +1,14 @@ +; Check that TLS PIC suffixes aren't accepted when non-PIC. + +; { dg-do assemble } +; { dg-options "--no-underscore --em=criself" } + + .syntax no_register_prefix + .text +start: + move.d extsym2:GDGOTREL,r5 ; { dg-error "operand" } + move.w extsym2:GDGOTREL16,r5 ; { dg-error "operand" } + move.d extsym1:DTPREL,r4 ; { dg-error "operand" } + move.w extsym3:DTPREL16,r6 ; { dg-error "operand" } + move.w extsym13:TPOFFGOT16,r10 ; { dg-error "operand" } + move extsym4:TPOFFGOT,srp ; { dg-error "operand" } |