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]
Other format: [Raw text]

[testsuite] new test case to check --gc-section option for h8/300 target


Hi,

	Please find attached patch which implements a Dejagnu test case to check --gc-section option for H8/300 target.


==========================================================================
testsuite/Changelog

2004-07-08  Nitin Yewale <nitiny@kpitcummins.com>

	* ld-h8300/h8300.exp : addition of gcsection test case
	* ld-h8300/gcsection.s : New test
	* ld-h8300/gcsection.d : New test
==========================================================================
--- binutils-040628/ld/testsuite/ld-h8300/h8300.exp	2004-07-08 14:56:01.000000000 +0530
+++ binutils-040628/ld/testsuite/ld-h8300/h8300.exp	2004-07-07 18:37:40.000000000 +0530
@@ -31,6 +31,7 @@ if {[istarget *-elf]} {
     run_dump_test relax-3
     run_dump_test relax-4
     run_dump_test relax-5
+    run_dump_test gcsection	
 } else {
     run_dump_test relax-3-coff
     run_dump_test relax-4-coff
--- /dev/null	2002-08-31 05:01:37.000000000 +0530
+++ binutils-040628/ld/testsuite/ld-h8300/gcsection.s	2004-07-08 15:50:37.000000000 +0530
@@ -0,0 +1,43 @@
+	.h8300h
+	.section	.text.functionWeUse,"ax",@progbits
+	.align 1
+	.global _functionWeUse
+_functionWeUse:
+	mov.l	er6,@-er7
+	mov.l	er7,er6
+	subs	#4,er7
+	mov.w	r0,@(-2,er6)
+	mov.w	@(-2,er6),r2
+	mov.w	r2,r0
+	adds	#4,er7
+	mov.l	@er7+,er6
+	rts
+	.size	_functionWeUse, .-_functionWeUse
+	.section	.text.functionWeDontUse,"ax",@progbits
+	.align 1
+	.global _functionWeDontUse
+_functionWeDontUse:
+	mov.l	er6,@-er7
+	mov.l	er7,er6
+	subs	#4,er7
+	mov.w	r0,@(-2,er6)
+	mov.w	@(-2,er6),r2
+	mov.w	r2,r0
+	adds	#4,er7
+	mov.l	@er7+,er6
+	rts
+	.size	_functionWeDontUse, .-_functionWeDontUse
+	.section	.text.start,"ax",@progbits
+	.align 1
+	.global _start
+_start:
+	mov.l	er6,@-er7
+	mov.l	er7,er6
+	mov.w	#75,r0
+	jsr	@_functionWeUse
+	mov.w	r0,r2
+	mov.w	r2,r0
+	mov.l	@er7+,er6
+	rts
+	.size	_start, .-_start
+	.end
--- /dev/null	2002-08-31 05:01:37.000000000 +0530
+++ binutils-040628/ld/testsuite/ld-h8300/gcsection.d	2004-07-08 14:44:16.000000000 +0530
@@ -0,0 +1,27 @@
+# name: H8300 GCC section test case
+# ld: --gc-sections  -m h8300helf
+# objdump: -d --no-show-raw-insn
+.*:     file format .*-h8300
+
+Disassembly of section .text:
+
+00000100 <_functionWeUse>:
+ 100:	01 00 6d f6       mov.l	er6,@-er7
+ 104:	0f f6             mov.l	er7,er6
+ 106:	1b 97             subs	#4,er7
+ 108:	6f e0 ff fe       mov.w	r0,@\(0xfffe:16,er6\)
+ 10c:	6f 62 ff fe       mov.w	@\(0xfffe:16,er6\),r2
+ 110:	0d 20             mov.w	r2,r0
+ 112:	0b 97             adds	#4,er7
+ 114:	01 00 6d 76       mov.l	@er7\+,er6
+ 118:	54 70             rts	
+
+0000011a <_start>:
+ 11a:	01 00 6d f6       mov.l	er6,@-er7
+ 11e:	0f f6             mov.l	er7,er6
+ 120:	79 00 00 4b       mov.w	#0x4b,r0
+ 124:	5e 00 01 00       jsr	@0x100:24
+ 128:	0d 02             mov.w	r0,r2
+ 12a:	0d 20             mov.w	r2,r0
+ 12c:	01 00 6d 76       mov.l	@er7\+,er6
+ 130:	54 70             rts	
==========================================================================
Regards,
Nitin Yewale,
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools were released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 


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