This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH]: Dwarf2 test for 68HC11/68HC12 gas



Hi!

It is possible to have a simple dwarf2 test using objdump -S.
So, I added some for 68HC11/68HC12 (using the existing assembly
sources).

I've committed this patch.

	Stephane

2001-01-11  Stephane Carrez  <Stephane.Carrez@worldnet.fr>

	* gas/m68hc11/all.exp: Add new tests for dwarf2.
	* gas/m68hc11/lbranch-dwarf2.d: New file, test for dwarf2.
	* gas/m68hc11/opers12-dwarf2.d: Likewise.
	* gas/m68hc11/insns-dwarf2.d: Likewise.
cvs server: Diffing testsuite/gas/m68hc11
Index: testsuite/gas/m68hc11/all.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/m68hc11/all.exp,v
retrieving revision 1.1
diff -u -r1.1 all.exp
--- all.exp	2000/06/19 01:22:41	1.1
+++ all.exp	2001/01/11 19:39:24
@@ -13,6 +13,9 @@
 run_dump_test insns
 run_dump_test lbranch
 run_dump_test all_insns
+run_dump_test insns-dwarf2
+run_dump_test lbranch-dwarf2
 
 # Some 68HC12 tests
 run_dump_test opers12
+run_dump_test opers12-dwarf2
\ No newline at end of file
Index: testsuite/gas/m68hc11/insns-dwarf2.d
===================================================================
RCS file: insns-dwarf2.d
diff -N insns-dwarf2.d
--- /dev/null	Tue May  5 13:32:27 1998
+++ insns-dwarf2.d	Thu Jan 11 11:39:24 2001
@@ -0,0 +1,111 @@
+#objdump: -S
+#as: -m68hc11 -gdwarf2
+#name: Dwarf2 test on insns.s
+#source: insns.s
+
+# Test handling of basic instructions.
+
+.*: +file format elf32\-m68hc11
+
+Disassembly of section .text:
+
+0+0 <_start>:
+	.globl _start
+	.sect .text
+
+_start:
+	lds #stack\+1024
+   0:	8e 04 00    	lds	#400 <L1\+0x3a9>
+	ldx #1
+   3:	ce 00 01    	ldx	#1 <_start\+0x1>
+
+00000006 <Loop>:
+Loop:	
+	jsr test
+   6:	bd 00 10    	jsr	10 <test>
+	dex
+   9:	09          	dex
+	bne Loop
+   a:	26 fa       	bne	6 <Loop>
+
+0000000c <Stop>:
+   c:	cd 03       	.byte	0xcd, 0x03
+Stop:
+	
+	.byte 0xcd
+	.byte 3	
+	bra _start
+   e:	20 f0       	bra	0 <_start>
+
+00000010 <test>:
+
+test:
+	ldd #2
+  10:	cc 00 02    	ldd	#2 <_start\+0x2>
+	jsr test2
+  13:	bd 00 17    	jsr	17 <test2>
+	rts
+  16:	39          	rts
+
+00000017 <test2>:
+
+B_low = 12
+A_low = 44
+D_low = 50
+value = 23
+		
+	.globl test2
+test2:
+	ldx value,y
+  17:	cd ee 17    	ldx	23,y
+	std value,x
+  1a:	ed 17       	std	23,x
+	ldd ,x
+  1c:	ec 00       	ldd	0,x
+	sty ,y
+  1e:	18 ef 00    	sty	0,y
+	stx ,y
+  21:	cd ef 00    	stx	0,y
+	brclr 6,x,#4,test2
+  24:	1f 06 04 ef 	brclr	6,x #\$04 17 <test2>
+	brclr 12,x #8 test2
+  28:	1f 0c 08 eb 	brclr	12,x #\$08 17 <test2>
+	ldd \*ZD1
+  2c:	dc 00       	ldd	\*0 <_start>
+	ldx \*ZD1\+2
+  2e:	de 02       	ldx	\*2 <_start\+0x2>
+	clr \*ZD2
+  30:	7f 00 00    	clr	0 <_start>
+	clr \*ZD2\+1
+  33:	7f 00 01    	clr	1 <_start\+0x1>
+	bne .-4
+  36:	26 fc       	bne	34 <test2\+0x1d>
+	beq .\+2
+  38:	27 02       	beq	3c <test2\+0x25>
+	bclr \*ZD1\+1, #32
+  3a:	15 01 20    	bclr	\*1 <_start\+0x1> #\$20
+	brclr \*ZD2\+2, #40, test2
+  3d:	13 02 28 d6 	brclr	\*2 <_start\+0x2> #\$28 17 <test2>
+	ldy #24\+_start-44
+  41:	18 ce ff ec 	ldy	#ffec <L1\+0xff95>
+	ldd B_low,y
+  45:	18 ec 0c    	ldd	12,y
+	addd A_low,y
+  48:	18 e3 2c    	addd	44,y
+	addd D_low,y
+  4b:	18 e3 32    	addd	50,y
+	subd A_low
+  4e:	b3 00 2c    	subd	2c <test2\+0x15>
+	subd #A_low
+  51:	83 00 2c    	subd	#2c <test2\+0x15>
+	jmp Stop
+  54:	7e 00 0c    	jmp	c <Stop>
+
+0+057 <L1>:
+L1:	
+	anda #%lo\(test2\)
+  57:	84 17       	anda	#23
+	andb #%hi\(test2\)
+  59:	c4 00       	andb	#0
+	rts
+  5b:	39          	rts
Index: testsuite/gas/m68hc11/lbranch-dwarf2.d
===================================================================
RCS file: lbranch-dwarf2.d
diff -N lbranch-dwarf2.d
--- /dev/null	Tue May  5 13:32:27 1998
+++ lbranch-dwarf2.d	Thu Jan 11 11:39:24 2001
@@ -0,0 +1,90 @@
+#objdump: -S
+#as: -m68hc11 -gdwarf2
+#name: Dwarf2 test on lbranch.s
+#source: lbranch.s
+
+# Test handling of basic instructions.
+
+.*: +file format elf32\-m68hc11
+
+Disassembly of section .text:
+
+0+0 <_rcall>:
+	.globl	_rcall
+	.globl _start
+_start:
+_rcall:
+	ldaa	\#0x10		;86 10
+   0:	86 10       	ldaa	\#16
+	jbra	Lend		; Must be switched to a jmp
+   2:	7e 01 0b    	jmp	10b <Lend>
+	jbsr	toto		; \-> to a jsr
+   5:	bd 01 1b    	jsr	11b <toto>
+	jbne	toto		; \-> to a beq\+jmp
+   8:	27 03       	beq	d <_rcall\+0xd>
+   a:	7e 01 1b    	jmp	11b <toto>
+	jbeq	toto		; -> to a bne\+jmp
+   d:	26 03       	bne	12 <_rcall\+0x12>
+   f:	7e 01 1b    	jmp	11b <toto>
+	jbcs	toto		; -> to a bcc\+jmp
+  12:	24 03       	bcc	17 <_rcall\+0x17>
+  14:	7e 01 1b    	jmp	11b <toto>
+	jbcc	toto		; -> to a bcs\+jmp
+  17:	25 03       	bcs	1c <_rcall\+0x1c>
+  19:	7e 01 1b    	jmp	11b <toto>
+	xgdx
+  1c:	8f          	xgdx
+	xgdx
+  1d:	8f          	xgdx
+	beq	bidule		; -> to a bne\+jmp
+  1e:	26 03       	bne	23 <_rcall\+0x23>
+  20:	7e 01 80    	jmp	180 <bidule>
+	bcs	bidule		; -> to a bcc\+jmp
+  23:	24 03       	bcc	28 <_rcall\+0x28>
+  25:	7e 01 80    	jmp	180 <bidule>
+	bcc	bidule		; -> to a bcs\+jmp
+  28:	25 03       	bcs	2d <_rcall\+0x2d>
+  2a:	7e 01 80    	jmp	180 <bidule>
+	xgdx
+  2d:	8f          	xgdx
+	jbra	200
+  2e:	7e 00 c8    	jmp	c8 <_rcall\+0xc8>
+	jbsr	1923
+  31:	bd 07 83    	jsr	783 <bidule\+0x603>
+	bne	Lend		; -> to a beq\+jmp
+  34:	27 03       	beq	39 <_rcall\+0x39>
+  36:	7e 01 0b    	jmp	10b <Lend>
+	jbsr	toto
+  39:	bd 01 1b    	jsr	11b <toto>
+	jbeq	toto
+  3c:	26 03       	bne	41 <_rcall\+0x41>
+  3e:	7e 01 1b    	jmp	11b <toto>
+	...
+	.skip 200
+	ldaa	\*dir		;96 33
+ 109:	96 00       	ldaa	\*0 <_rcall>
+
+0000010b <Lend>:
+Lend:
+	bhi	external_op
+ 10b:	23 03       	bls	110 <Lend\+0x5>
+ 10d:	7e 00 00    	jmp	0 <_rcall>
+	bls	external_op
+ 110:	22 03       	bhi	115 <Lend\+0xa>
+ 112:	7e 00 00    	jmp	0 <_rcall>
+	bsr	out
+ 115:	bd 00 00    	jsr	0 <_rcall>
+	ldx	#12
+ 118:	ce 00 0c    	ldx	#c <_rcall\+0xc>
+
+0000011b <toto>:
+toto:	
+	rts
+ 11b:	39          	rts
+	...
+
+00000180 <bidule>:
+	.skip 100
+bidule:
+	rts
+ 180:	39          	rts
Index: testsuite/gas/m68hc11/opers12-dwarf2.d
===================================================================
RCS file: opers12-dwarf2.d
diff -N opers12-dwarf2.d
--- /dev/null	Tue May  5 13:32:27 1998
+++ opers12-dwarf2.d	Thu Jan 11 11:39:24 2001
@@ -0,0 +1,216 @@
+#objdump: -S
+#as: -m68hc12 -gdwarf2
+#name: Dwarf2 test on opers12.s
+#source: opers12.s
+
+.*: +file format elf32\-m68hc12
+
+Disassembly of section .text:
+
+0+0 <start>:
+	sect .text
+	globl start
+
+start:
+	anda	\[12,x\]		; Indexed indirect
+   0:	a4 e3 00 0c 	anda	\[12,X\]
+	ldaa	#10
+   4:	86 0a       	ldaa	#10
+	ldx	L1
+   6:	fe 00 09    	ldx	9 <L1>
+
+00000009 <L1>:
+L1:	ldy	,x
+   9:	ed 00       	ldy	0,X
+	addd	1,y		; Offset from register
+   b:	e3 41       	addd	1,Y
+	subd	\-1,y
+   d:	a3 5f       	subd	\-1,Y
+	eora	15,y
+   f:	a8 4f       	eora	15,Y
+	eora	\-16,y
+  11:	a8 50       	eora	\-16,Y
+	eorb	16,y
+  13:	e8 e8 10    	eorb	16,Y
+	eorb	\-17,y
+  16:	e8 e9 ef    	eorb	\-17,Y
+	oraa	128,sp
+  19:	aa f0 80    	oraa	128,SP
+	orab	\-128,sp
+  1c:	ea f1 80    	orab	\-128,SP
+	orab	255,x
+  1f:	ea e0 ff    	orab	255,X
+	orab	\-256,x
+  22:	ea e1 00    	orab	\-256,X
+	anda	256,x
+  25:	a4 e2 01 00 	anda	256,X
+	andb	\-257,x
+  29:	e4 e2 fe ff 	andb	\-257,X
+	anda	\[12,x\]		; Indexed indirect \(16\-bit offset\)
+  2d:	a4 e3 00 0c 	anda	\[12,X\]
+	ldaa	\[257,y\]
+  31:	a6 eb 01 01 	ldaa	\[257,Y\]
+	ldab	\[32767,sp\]
+  35:	e6 f3 7f ff 	ldab	\[32767,SP\]
+	ldd	\[32768,pc\]
+  39:	ec fb 80 00 	ldd	\[32768,PC\]
+	ldd	L1,pc
+  3d:	ec f8 09    	ldd	9,PC
+	std	a,x		; Two\-reg index
+  40:	6c e4       	std	A,X
+	ldx	b,x
+  42:	ee e5       	ldx	B,X
+	stx	d,y
+  44:	6e ee       	stx	D,Y
+	addd	1,\+x		; Pre\-Auto inc
+  46:	e3 20       	addd	1,\+X
+	addd	2,\+x
+  48:	e3 21       	addd	2,\+X
+	addd	8,\+x
+  4a:	e3 27       	addd	8,\+X
+	addd	1,sp\+		; Post\-Auto inc
+  4c:	e3 b0       	addd	1,SP\+
+	addd	2,sp\+
+  4e:	e3 b1       	addd	2,SP\+
+	addd	8,sp\+
+  50:	e3 b7       	addd	8,SP\+
+	subd	1,\-y		; Pre\-Auto dec
+  52:	a3 6f       	subd	1,\-Y
+	subd	2,\-y
+  54:	a3 6e       	subd	2,\-Y
+	subd	8,\-y
+  56:	a3 68       	subd	8,\-Y
+	addd	1,y\-		; Post\-Auto dec
+  58:	e3 7f       	addd	1,Y\-
+	addd	2,y\-
+  5a:	e3 7e       	addd	2,Y\-
+	addd	8,y\-
+  5c:	e3 78       	addd	8,Y\-
+	std	\[d,x\]		; Indexed indirect with two reg index
+  5e:	6c e7       	std	\[D,X\]
+	std	\[d,y\]
+  60:	6c ef       	std	\[D,Y\]
+	std	\[d,sp\]
+  62:	6c f7       	std	\[D,SP\]
+	std	\[d,pc\]
+  64:	6c ff       	std	\[D,PC\]
+	beq	L1
+  66:	27 a1       	beq	9 <L1>
+	lbeq	start
+  68:	18 27 ff 94 	lbeq	0 <start>
+	lbcc	L2
+  6c:	18 24 00 4c 	lbcc	bc <L2>
+;;
+;; Move insn with various operands
+;; 
+	movb	start, 1,x
+  70:	18 09 01 00 	movb	0 <start>, 1,X
+  74:	00 
+	movw	1,x, start
+  75:	18 05 01 00 	movw	1,X, 0 <start>
+  79:	00 
+	movb	start, 1,\+x
+  7a:	18 09 20 00 	movb	0 <start>, 1,\+X
+  7e:	00 
+	movb	start, 1,\-x
+  7f:	18 09 2f 00 	movb	0 <start>, 1,\-X
+  83:	00 
+	movb	#23, 1,\-sp
+  84:	18 08 af 17 	movb	#23, 1,\-SP
+	movb	L1, L2
+  88:	18 0c 00 09 	movb	9 <L1>, bc <L2>
+  8c:	00 bc 
+	movb	L1, a,x
+  8e:	18 09 e4 00 	movb	9 <L1>, A,X
+  92:	09 
+	movw	L1, b,x
+  93:	18 01 e5 00 	movw	9 <L1>, B,X
+  97:	09 
+	movw	L1, d,x
+  98:	18 01 e6 00 	movw	9 <L1>, D,X
+  9c:	09 
+	movw	d,x, a,x
+  9d:	18 02 e6 e4 	movw	D,X, A,X
+	movw	b,sp, d,pc
+  a1:	18 02 f5 fe 	movw	B,SP, D,PC
+	movw	b,sp, L1
+  a5:	18 05 f5 00 	movw	B,SP, 9 <L1>
+  a9:	09 
+	movw	b,sp, 1,x
+  aa:	18 02 f5 01 	movw	B,SP, 1,X
+	movw	d,x, a,y
+  ae:	18 02 e6 ec 	movw	D,X, A,Y
+	trap	#0x30
+  b2:	18 30       	trap	#48
+	trap	#0x39
+  b4:	18 39       	trap	#57
+	trap	#0x40
+  b6:	18 40       	trap	#64
+	trap	#0x80
+  b8:	18 80       	trap	#128
+	trap	#255
+  ba:	18 ff       	trap	#255
+
+000000bc <L2>:
+L2:	
+	movw 1,x,2,x
+  bc:	18 02 01 02 	movw	1,X, 2,X
+	movw \-1,\-1
+  c0:	18 04 ff ff 	movw	ffff <bb\+0xd7ff>, ffff <bb\+0xd7ff>
+  c4:	ff ff 
+	movw \-1,1,x
+  c6:	18 01 01 ff 	movw	ffff <bb\+0xd7ff>, 1,X
+  ca:	ff 
+	movw #\-1,1,x
+  cb:	18 00 01 ff 	movw	#ffff <bb\+0xd7ff>, 1,X
+  cf:	ff 
+	movw 3,8
+  d0:	18 04 00 03 	movw	3 <start\+0x3>, 8 <start\+0x8>
+  d4:	00 08 
+	movw #3,3
+  d6:	18 03 00 03 	movw	#3 <start\+0x3>, 3 <start\+0x3>
+  da:	00 03 
+	movw #3,1,x
+  dc:	18 00 01 00 	movw	#3 <start\+0x3>, 1,X
+  e0:	03 
+	movw 3,1,x
+  e1:	18 01 01 00 	movw	3 <start\+0x3>, 1,X
+  e5:	03 
+	movw 3,\+2,x
+  e6:	18 01 02 00 	movw	3 <start\+0x3>, 2,X
+  ea:	03 
+	movw 4,\-2,x
+  eb:	18 01 1e 00 	movw	4 <start\+0x4>, \-2,X
+  ef:	04 
+	rts
+  f0:	3d          	rts
+
+000000f1 <post_indexed_pb>:
+;;
+;; Post\-index byte with relocation
+;; 
+post_indexed_pb:
+t1:
+	leas	abort,x
+  f1:	1b e2 00 00 	leas	0,X
+
+000000f5 <t2>:
+t2:
+	leax	t2\-t1,y
+  f5:	1a 44       	leax	4,Y
+	leax	toto,x
+  f7:	1a e2 00 64 	leax	100,X
+	leas	toto\+titi,sp
+  fb:	1b f2 00 6e 	leas	110,SP
+	leay	titi,x
+  ff:	19 e2 00 0a 	leay	10,X
+	leas	bb,y
+ 103:	1b ea 28 00 	leas	10240,Y
+	leas	min5b,pc
+ 107:	1b fa 00 ff 	leas	255,PC
+	leas	max5b,pc
+ 10b:	1b fa 00 00 	leas	0,PC
+	leas	min9b,pc
+ 10f:	1b fa 00 ff 	leas	255,PC
+	leas	max9b,pc
+ 113:	1b fa 00 00 	leas	0,PC

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]