aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2001-02-04 13:53:49 +0000
committerStephane Carrez <stcarrez@nerim.fr>2001-02-04 13:53:49 +0000
commit4f69f9744ab2a8e4c25934f733cf5bda9b3b65ac (patch)
tree1ce38ca314f71d40415488a41e9054666af7fd5d /gas/testsuite
parent32fe09500361e2442e2635e96dc81dbc1647f124 (diff)
downloadgdb-4f69f9744ab2a8e4c25934f733cf5bda9b3b65ac.zip
gdb-4f69f9744ab2a8e4c25934f733cf5bda9b3b65ac.tar.gz
gdb-4f69f9744ab2a8e4c25934f733cf5bda9b3b65ac.tar.bz2
* gas/m68hc11/malis.s: New test to verify compliance with Motorola
Assembly Language Input Standard. * gas/m68hc11/malis.d: New file. * gas/m68hc11/malis-include.s: New file. * gas/m68hc11/all.exp: Add the new test.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog8
-rw-r--r--gas/testsuite/gas/m68hc11/all.exp3
-rw-r--r--gas/testsuite/gas/m68hc11/malis-include.s19
-rw-r--r--gas/testsuite/gas/m68hc11/malis.d37
-rw-r--r--gas/testsuite/gas/m68hc11/malis.s240
5 files changed, 307 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 1d8f6c8..55f3bfd 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2001-02-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * gas/m68hc11/malis.s: New test to verify compliance with Motorola
+ Assembly Language Input Standard.
+ * gas/m68hc11/malis.d: New file.
+ * gas/m68hc11/malis-include.s: New file.
+ * gas/m68hc11/all.exp: Add the new test.
+
2001-01-12 Alan Modra <alan@linuxcare.com.au>
* gas/i386/i386.exp (gas_64_check): Correct target string.
diff --git a/gas/testsuite/gas/m68hc11/all.exp b/gas/testsuite/gas/m68hc11/all.exp
index 2c6c292..9fe5bf4 100644
--- a/gas/testsuite/gas/m68hc11/all.exp
+++ b/gas/testsuite/gas/m68hc11/all.exp
@@ -16,6 +16,9 @@ run_dump_test all_insns
run_dump_test insns-dwarf2
run_dump_test lbranch-dwarf2
+# Compliance with Motorola Assembly Language Input Standard
+run_dump_test malis
+
# Some 68HC12 tests
run_dump_test opers12
run_dump_test opers12-dwarf2 \ No newline at end of file
diff --git a/gas/testsuite/gas/m68hc11/malis-include.s b/gas/testsuite/gas/m68hc11/malis-include.s
new file mode 100644
index 0000000..5ee6580
--- /dev/null
+++ b/gas/testsuite/gas/m68hc11/malis-include.s
@@ -0,0 +1,19 @@
+;;
+;; This file verifies the compliance with the Motorola specification:
+;;
+;; MOTOROLA STANDARDS
+;; Document #1001, Version 1.0
+;; SPECIFICATION FOR Motorola 8- and 16-Bit ASSEMBLY LANGUAGE INPUT STANDARD
+;; 26, October 1999
+;;
+;; Available at:
+;;
+;; http://www.mcu.motsps.com/dev_tools/hc12/eabi/m8-16alis.pdf
+;;
+;; Lines starting with '#' represent instructions that fail in GAS.
+;;
+;;
+;; Section 8.2.12.6 Include File - include
+ section .text
+value: set 1
+ ldy #value
diff --git a/gas/testsuite/gas/m68hc11/malis.d b/gas/testsuite/gas/m68hc11/malis.d
new file mode 100644
index 0000000..73993c8
--- /dev/null
+++ b/gas/testsuite/gas/m68hc11/malis.d
@@ -0,0 +1,37 @@
+#objdump: -d --prefix-addresses
+#as: -m68hc11 --mri -I../testsuite/gas/m68hc11/
+#name: Motorola Assembly Language Input Standard
+
+# Test compliance with MALIS
+
+.*: +file format elf32\-m68hc11
+
+Disassembly of section .text:
+0+000 <L0> ldaa 1,x
+0+002 <L1> ldaa #44
+0+004 <L_txt2> ldx #0+000 <L0>
+0+007 <L_constant> ldaa #123
+0+009 <L_constant\+0x2> ldaa #233
+0+00b <L_constant\+0x4> ldab #138
+0+00d <L_constant\+0x6> ldab #7
+0+00f <L_constant\+0x8> ldaa #60
+0+011 <L_constant\+0xa> ldaa #255
+0+013 <L12> ldaa #174
+0+015 <L13> ldaa #178
+0+017 <L11> ldx #0+0af <entry\+0x6c>
+0+01a <L11\+0x3> ldx #0+001 <L0\+0x1>
+0+01d <L11\+0x6> ldx #0+001 <L0\+0x1>
+0+020 <L11\+0x9> ldx #0+000 <L0>
+0+023 <L11\+0xc> ldab #210
+0+025 <L_if> ldx #0+001 <L0\+0x1>
+0+028 <L_if\+0x3> ldaa #31
+0+02a <L_if\+0x5> ldaa #4
+0+02c <L_if\+0x7> ldx #0+017 <L11>
+0+02f <L_if\+0xa> ldx #0+004 <L_txt2>
+0+032 <L_if\+0xd> ldy #0+001 <L0\+0x1>
+0+036 <L_if\+0x11> ldy #0+001 <L0\+0x1>
+0+03a <L_if\+0x15> ldaa #23
+0+03c <L_if\+0x17> staa 0+018 <L11\+0x1>
+0+03f <L_if\+0x1a> rts
+0+040 <L_if\+0x1b> ldaa 0+017 <L11>
+0+043 <entry> rts
diff --git a/gas/testsuite/gas/m68hc11/malis.s b/gas/testsuite/gas/m68hc11/malis.s
new file mode 100644
index 0000000..c35db9c
--- /dev/null
+++ b/gas/testsuite/gas/m68hc11/malis.s
@@ -0,0 +1,240 @@
+;;
+;; This file verifies the compliance with the Motorola specification:
+;;
+;; MOTOROLA STANDARDS
+;; Document #1001, Version 1.0
+;; SPECIFICATION FOR Motorola 8- and 16-Bit ASSEMBLY LANGUAGE INPUT STANDARD
+;; 26, October 1999
+;;
+;; Available at:
+;;
+;; http://www.mcu.motsps.com/dev_tools/hc12/eabi/m8-16alis.pdf
+;;
+;; Lines starting with '#' represent instructions that fail in GAS.
+;;
+;;
+;; Section 8.2 INPUTS
+ ;; Validated within the whole file
+
+;; Section 8.2.1 Character Set
+ ;; TBD
+
+;; Section 8.2.2 Assembly Language Statement
+ ;; Validated within the whole file
+
+;; Section 8.2.3 Comments
+ ; Motorola comment
+ ;; This file is full of comments
+
+;; Section 8.2.5 Location Counter
+ section .text
+
+_start:
+L0: * ; L0 set to 0 (relative to text)
+ ldaa 1,x
+L1: equ * ; L1 set to 2 (relative to text)
+
+;; Section 8.2.6 Sections
+ section .data
+ section .text
+ section empty
+ section .text
+
+;; Section 8.2.7 Expressions
+L2: equ 23 ; Absolute = 0x17
+L3: equ L0-23 ; Simple relocatable
+
+;; Section 8.2.7.1 Primary Expression
+L4: equ 45 ; Numeric = 0x2d
+L5: equ L0 ; Symbolic
+
+;; Section 8.2.7.2 Absolute Expression
+L_txt: ldaa #44
+L_txt2:
+L6: equ -L4 ; unary expr 0xffffffd3
+L7: equ L6+1000 ; binary expr 0x03bb
+L8: equ L6-12 ; 0xffffffc7
+L9: equ L_txt2-L_txt ; reloc - reloc 2 = sizeof(ldaa #44)
+
+;; Section 8.2.7.3 Simple Relocatable Expressions
+L10: equ _start ; symbol 0 + text
+L11: equ L10+23 ; reloc+abs 0x17 + text
+L12: equ L11-4 ; reloc-abs 0x13 + text
+L13: equ L12+L9 ; reloc+abs 0x15 + text
+
+;; Section 8.2.8 Symbols
+ section .text
+Text_Symbol:
+ ldx #Data_Symbol
+
+ section .data
+Data_Symbol:
+
+;; Section 8.2.8.1 Labels
+L_label_shall_be_significant_to_at_least_32_chars:
+ dc.b 1
+L_label_lower: ; Labels are case sensitive
+ dc.b 2
+L_Label_Lower:
+ dc.b 3
+
+;; Section 8.2.9 Constants
+;
+; Section 8.2.9.1 Decimal Constants
+ section .text
+L_constant:
+ ldaa #123 ; -> ldaa #0x7b
+ ldaa #-23 ; -> ldaa #0xe9
+
+;; Section 8.2.9.2 Binary Constants
+ ldab #%10001010 ; -> ldab #0x8A
+ ldab #%0111 ; -> ldab #0x07
+
+;; Section 8.2.9.3 Octal Constants
+ ldaa #@74 ; -> ldaa 0x3c
+ ldaa #@377 ; -> ldaa 0xff
+
+;; Section 8.2.9.4 Hexadecimal Constants
+ ldaa #$ae ; -> ldaa 0xae
+ ldaa #$B2 ; -> ldaa 0xb2
+
+;; Section 8.2.9.5 String Constants
+ section .data
+# ascii '"Single quote string"'
+ ascii "'Double quote string'"
+
+;; Section 8.2.9.6 Floating Point Constants
+;; No specification
+L_float: float 3.241592e-2
+
+;; Section 8.2.10 Operators
+ section .text
+L_operator:
+ ldx #(((1<<3)&(1<<3)|2)<<4)+(4*4-1)
+ ldx #(L2>=23)&1-(L2<=23)&1+(L2==23)&1 ; -> ldx #1
+ ldx #(L2>23)&1-(L2<23)&1+(L2==23)&1 ; -> ldx #0
+ ldx #1-1+1-1+1-1
+ ldab #~L4 ; -> ldab #0xd2
+# ldab #<_start ; force to 8-bit
+# ldx #>_start ; force to 16-bit
+# ldab #page(_start) ; 68HC12 page number of symbol
+
+;; Section 8.2.11 Instructions
+;; Defined by other tests
+
+;; Section 8.2.12 Assembler Directives
+;;
+;; Section 8.2.12.1 Conditional Directives
+;;
+# The specification says we are allowed to have spaces in expressions.
+# This does not work with GAS in mri mode, the instruction 'if L2 < 24'
+# is in fact treated as 'if L2'.
+L_if:
+ if L2<24 ; true
+ ldx #1 ; -> ldx #1
+ else
+ ldx #2
+ endif
+ if L2<23||L2>23||L2==22+1 ; true
+ if L2<23 ; false
+ ldaa #0
+ endif
+ if L2>23 ; false
+ ldaa #1
+ endif
+ if L2 == 23 ; true
+ ldaa #L2+8 ; -> ldaa #31
+ endif
+ if L2+2<23+2 ; false
+ if L2+4>23+4
+ ldaa #1
+ elseif L2==23
+ ldaa #2
+ else
+ ldaa #3
+ endif
+ elseif L2==23 ; true
+ ldaa #4 ; -> ldaa #4
+ else
+ ldaa #5
+ endif
+ endif
+ ifdef L1 ; true
+ ldx #23 ; -> ldx #0x17
+ endif
+ ifndef L_undef ; true
+ ldx #4 ; -> ldx #4
+ endif
+
+;; Section 8.2.12.2 Define Constant -dc
+ section .data
+L_const_data:
+ dc.b (1<<3)|2 ; 0x0a
+ dc.w (1<<9)+2 ; 0x02 0x02
+ dc.l $12345678
+ dc.b 10
+ dc.l (1<<9)*(3<<12)
+# dc.b "Hello"
+# dc.w "World"
+# dc.l "!!!"
+
+;; Section 8.2.12.3 Define Constant Block -dcb
+ dcb.b 3,2
+ dcb.w 2,$55AA
+ dcb.l 2,$12345678
+ dcb.b 10,2
+ dcb.w 5,$55AA
+ dcb.l 2,$12345678
+# dcb.b 4, 12 ; Fails in GAS due to space
+
+;; Section 8.2.12.4 Define Storage - ds
+ ds.b 4
+ ds.w 2
+ ds.l 1
+ ds 2
+
+;; Section 8.2.12.5 Equate Symbol Value - equ
+L_equ1: equ (1<<8)+3
+L_equ2: equ L_equ1*3
+L_equ3: equ L_equ2-L_equ1
+
+;; Section 8.2.12.6 Include File - include
+# include 'malis-include.s'
+# include "malis-include.s"
+ include malis-include.s
+ include malis-include.s
+
+;; Section 8.2.12.7 Origin - org
+ section .text
+# org $100
+ ldaa #23
+# org $200
+ staa 24
+# org $0
+ rts
+
+;; Section 8.2.12.8 Define Section - section
+ section .text
+ ldaa 23
+
+ section .data
+ dc.b 23
+
+;; Section 8.2.12.9 Set Value of Symbol - set
+s1: set 3
+s1: set 4
+s2: set s1+2
+s3: set s2+4
+
+;; Section 8.2.12.10 External Symbol Definition - xdef
+ xdef s1
+ xdef s2
+ xdef entry
+
+;; Section 8.2.12.11 External Symbol Reference - xref
+ section .text
+ xref printf
+ xrefb write
+entry:
+ rts
+