[testsuite] help req for scanning assembly output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

	I am writing a dejagnu test case for following program.

***************************** test.c ***************************
/* { dg-do compile { target h8300-*-* } } */
/* { dg-options "-O3 -mh -mn " } */
int a;
__attribute__ ((interrupt_handler,saveall)) void foo()
{
	int b;
	a = 1 ;
	b = a++;
}
/* { dg-final { scan-assembler "er0\,\@-er7" } } */
****************************************************************

************************ASSEMBLY OUTPUT test.c*******************
	.h8300hn
	.section .text
	.align 1
	.global _foo
_foo:
	mov.l	er6,@-er7
	mov.w	r7,r6
	mov.l	er0,@-er7
	mov.l	er1,@-er7
	mov.l	er2,@-er7
	mov.l	er3,@-er7
	mov.l	er4,@-er7
	mov.l	er5,@-er7
	mov.w	#1,r2
	mov.w	r2,@_a
	mov.w	#_a,r3
	adds	#1,er2
	mov.w	r2,@er3
	subs	#1,er2
	mov.w	r2,r5
	mov.l	@er7+,er5
	mov.l	@er7+,er4
	mov.l	@er7+,er3
	mov.l	@er7+,er2
	mov.l	@er7+,er1
	mov.l	@er7+,er0
	mov.l	@er7+,er6
	rte
	.size	_foo, .-_foo
	.comm	_a,2,2
	.ident	"GCC: (GNU) 3.4-GNUH8_v0402"
	.end
****************************************************************
	I want to check whether generated assembly code contains pushes and pops all registers or not for interrupt service routine using Dejagnu framework. For e.g. "mov.l	er0,@-er7"
	
	To do so I am using "{dg-final {scan-assembler}}" TCL macro but not able to figure out the format for the same.

	Any help in these regards is appreciated.
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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux