aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-12-31 07:40:56 +0000
committerNick Clifton <nickc@redhat.com>2002-12-31 07:40:56 +0000
commit4630c8033aae58ebc6681ee768a95b0414b0fc16 (patch)
treeb177d65e3d23759fdde8354c245e3045c55e616b /gas
parent54610ba2f8662e8e26d0e1d9b108eee49da91b7a (diff)
downloadgdb-4630c8033aae58ebc6681ee768a95b0414b0fc16.zip
gdb-4630c8033aae58ebc6681ee768a95b0414b0fc16.tar.gz
gdb-4630c8033aae58ebc6681ee768a95b0414b0fc16.tar.bz2
oops - omitted from previous delta
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/gas/msp430/msp430.exp20
-rw-r--r--gas/testsuite/gas/msp430/opcode.d45
-rw-r--r--gas/testsuite/gas/msp430/opcode.s54
3 files changed, 119 insertions, 0 deletions
diff --git a/gas/testsuite/gas/msp430/msp430.exp b/gas/testsuite/gas/msp430/msp430.exp
new file mode 100644
index 0000000..a45ae4b
--- /dev/null
+++ b/gas/testsuite/gas/msp430/msp430.exp
@@ -0,0 +1,20 @@
+#
+# msp430 tests
+#
+proc run_list_test { name opts } {
+ global srcdir subdir
+ set testname "msp430 $name"
+ set file $srcdir/$subdir/$name
+ gas_run ${name}.s $opts ">&dump.out"
+ if { [regexp_diff "dump.out" "${file}.l"] } then {
+ fail $testname
+ verbose "output is [file_contents "dump.out"]" 2
+ exit
+ return
+ }
+ pass $testname
+}
+
+if [expr [istarget "msp430-*-*"]] then {
+ run_dump_test "opcode"
+}
diff --git a/gas/testsuite/gas/msp430/opcode.d b/gas/testsuite/gas/msp430/opcode.d
new file mode 100644
index 0000000..3f45127
--- /dev/null
+++ b/gas/testsuite/gas/msp430/opcode.d
@@ -0,0 +1,45 @@
+#objdump: -d --prefix-addresses --show-raw-insn
+#name: MSP430 basic instructions
+
+.*: +file format .*msp.*
+
+Disassembly of section .text:
+0+000 <[^>]*> 1b f3 and #1, r11 ;r3 As==01
+0+002 <[^>]*> 3a e3 inv r10 ;
+0+004 <[^>]*> 3b e0 ff 00 xor #255, r11 ;#0x00ff
+0+008 <[^>]*> 3c d2 bis #8, r12 ;r2 As==11
+0+00a <[^>]*> 3d b0 10 00 bit #16, r13 ;#0x0010
+0+00e <[^>]*> 3e c0 a0 00 bic #160, r14 ;#0x00a0
+0+012 <[^>]*> 0f 93 cmp #0, r15 ;r3 As==00
+0+014 <[^>]*> 1a 83 dec r10 ;
+0+016 <[^>]*> 0b 73 sbc r11 ;
+0+018 <[^>]*> 1c 53 inc r12 ;
+0+01a <[^>]*> 2d 63 addc #2, r13 ;r3 As==10
+0+01c <[^>]*> 0e 12 push r14 ;
+0+01e <[^>]*> 3f 41 pop r15 ;
+0+020 <[^>]*> 8a 11 sxt r10 ;
+0+022 <[^>]*> 0b 11 rra r11 ;
+0+024 <[^>]*> 8c 10 swpb r12 ;
+0+026 <[^>]*> 0d 10 rrc r13 ;
+0+028 <[^>]*> 30 41 ret
+0+02a <[^>]*> 31 40 00 00 mov #0, r1 ;#0x0000
+0+02e <[^>]*> b0 12 00 00 call #0 ;#0x0000
+0+032 <[^>]*> 1e 42 00 00 mov &0x0000,r14 ;0x0000
+0+036 <[^>]*> 0f 4e mov r14, r15 ;
+0+038 <[^>]*> 0f 5f rla r15 ;
+0+03a <[^>]*> 0f 7f subc r15, r15 ;
+0+03c <[^>]*> 3f e3 inv r15 ;
+0+03e <[^>]*> b0 12 00 00 call #0 ;#0x0000
+0+042 <[^>]*> 82 4e 00 00 mov r14, &0x0000 ;
+0+046 <[^>]*> 82 4f 00 00 mov r15, &0x0000 ;
+0+04a <[^>]*> 1e 42 00 00 mov &0x0000,r14 ;0x0000
+0+04e <[^>]*> 0f 4e mov r14, r15 ;
+0+050 <[^>]*> 0f 5f rla r15 ;
+0+052 <[^>]*> 0f 7f subc r15, r15 ;
+0+054 <[^>]*> 3f e3 inv r15 ;
+0+056 <[^>]*> b0 12 00 00 call #0 ;#0x0000
+0+05a <[^>]*> 82 4e 00 00 mov r14, &0x0000 ;
+0+05e <[^>]*> 82 4f 00 00 mov r15, &0x0000 ;
+0+062 <[^>]*> 3f 40 f0 00 mov #240, r15 ;#0x00f0
+0+066 <[^>]*> 30 40 00 00 br #0x0000 ;
+
diff --git a/gas/testsuite/gas/msp430/opcode.s b/gas/testsuite/gas/msp430/opcode.s
new file mode 100644
index 0000000..237bd1f
--- /dev/null
+++ b/gas/testsuite/gas/msp430/opcode.s
@@ -0,0 +1,54 @@
+ .arch msp430x123
+ .text
+ .p2align 1,0
+
+.global foo
+foo:
+ and #1, r11
+ inv r10
+ xor #0x00ff, r11
+ bis #8, r12
+ bit #0x10, r13
+ bic #0xa0, r14
+ cmp #0, r15
+ sub #1, r10
+ subc #0, r11
+ add #1, r12
+ addc #2, r13
+ push r14
+ pop r15
+ sxt r10
+ rra r11
+ swpb r12
+ rrc r13
+ ret
+
+ .p2align 1,0
+.global main
+ .type main,@function
+main:
+ mov #(__stack-0), r1
+ call #foo
+ mov &a, r14
+ mov r14, r15
+ rla r15
+ subc r15, r15
+ inv r15
+ call #__floatsisf
+ mov r14, &c
+ mov r15, &c+2
+ mov &b, r14
+ mov r14, r15
+ rla r15
+ subc r15, r15
+ inv r15
+ call #__floatsisf
+ mov r14, &d
+ mov r15, &d+2
+ mov #llo(240), r15
+ br #__stop_progExec__
+ .comm a,2,2
+ .comm b,2,2
+ .comm c,4,2
+ .comm d,4,2
+