[PATCH 2/4] MIPS/GAS: Reformat the SVR4 PIC JAL test

Maciej W. Rozycki macro@codesourcery.com
Tue Jul 20 11:43:00 GMT 2010


Hi,

 This is a change that reformats branch test patterns so that any 
insertions/removals only require to modify the affected area of the 
template.  This makes it easier to catch unwanted changes when such 
modifications are applied.

 Additionally missing escapes for the "." special character are added.  
Also the source for the test is reformatted, fixing up white space, adding 
a missing full stop and the usual sequence to add trailing zeroes 
reworked.  Given the function is fully annotated with .ent, .end, etc. I 
couldn't resist the temptation to complete symbol attributes by adding a 
.size directive.

 Other than that there are no functional changes.

2010-07-20  Maciej W. Rozycki  <macro@codesourcery.com>

	gas/testsuite/
	* gas/mips/jal-svr4pic.d: Reformat.  Use --show-raw-insn with 
	`objdump'.
	* gas/mips/jal-svr4pic.s: Reformat.  Add .size.  Fix up trailing
	zeroes.

 OK to commit?

  Maciej

binutils-jal-svr4pic.diff
Index: binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/jal-svr4pic.d
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/testsuite/gas/mips/jal-svr4pic.d	2010-07-20 00:35:38.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/jal-svr4pic.d	2010-07-20 02:44:01.000000000 +0100
@@ -1,4 +1,4 @@
-#objdump: -dr --prefix-addresses -mmips:3000
+#objdump: -dr --prefix-addresses --show-raw-insn -mmips:3000
 #name: MIPS R3000 jal-svr4pic
 #as: -32 -mips1 -KPIC -mtune=r3000
 
@@ -6,45 +6,45 @@
 
 .*: +file format .*mips.*
 
-Disassembly of section .text:
-0+0000 <[^>]*> lui	gp,0x0
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 3c1c0000 	lui	gp,0x0
 [ 	]*0: R_MIPS_HI16	_gp_disp
-0+0004 <[^>]*> addiu	gp,gp,0
+[0-9a-f]+ <[^>]*> 279c0000 	addiu	gp,gp,0
 [ 	]*4: R_MIPS_LO16	_gp_disp
-0+0008 <[^>]*> addu	gp,gp,t9
-0+000c <[^>]*> sw	gp,0\(sp\)
-0+0010 <[^>]*> jalr	t9
-0+0014 <[^>]*> nop
-0+0018 <[^>]*> lw	gp,0\(sp\)
-0+001c <[^>]*> jalr	a0,t9
-0+0020 <[^>]*> nop
-0+0024 <[^>]*> lw	gp,0\(sp\)
-0+0028 <[^>]*> nop
-0+002c <[^>]*> lw	t9,0\(gp\)
+[0-9a-f]+ <[^>]*> 0399e021 	addu	gp,gp,t9
+[0-9a-f]+ <[^>]*> afbc0000 	sw	gp,0\(sp\)
+[0-9a-f]+ <[^>]*> 0320f809 	jalr	t9
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 8fbc0000 	lw	gp,0\(sp\)
+[0-9a-f]+ <[^>]*> 03202009 	jalr	a0,t9
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 8fbc0000 	lw	gp,0\(sp\)
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 8f990000 	lw	t9,0\(gp\)
 [ 	]*2c: R_MIPS_GOT16	.text
-0+0030 <[^>]*> nop
-0+0034 <[^>]*> addiu	t9,t9,0
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 27390000 	addiu	t9,t9,0
 [ 	]*34: R_MIPS_LO16	.text
-0+0038 <[^>]*> jalr	t9
+[0-9a-f]+ <[^>]*> 0320f809 	jalr	t9
 [ 	]*38: R_MIPS_JALR	text_label
-0+003c <[^>]*> nop
-0+0040 <[^>]*> lw	gp,0\(sp\)
-0+0044 <[^>]*> nop
-0+0048 <[^>]*> lw	t9,0\(gp\)
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 8fbc0000 	lw	gp,0\(sp\)
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 8f990000 	lw	t9,0\(gp\)
 [ 	]*48: R_MIPS_CALL16	weak_text_label
-0+004c <[^>]*> nop
-0+0050 <[^>]*> jalr	t9
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 0320f809 	jalr	t9
 [ 	]*50: R_MIPS_JALR	weak_text_label
-0+0054 <[^>]*> nop
-0+0058 <[^>]*> lw	gp,0\(sp\)
-0+005c <[^>]*> nop
-0+0060 <[^>]*> lw	t9,0\(gp\)
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 8fbc0000 	lw	gp,0\(sp\)
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 8f990000 	lw	t9,0\(gp\)
 [ 	]*60: R_MIPS_CALL16	external_text_label
-0+0064 <[^>]*> nop
-0+0068 <[^>]*> jalr	t9
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 0320f809 	jalr	t9
 [ 	]*68: R_MIPS_JALR	external_text_label
-0+006c <[^>]*> nop
-0+0070 <[^>]*> lw	gp,0\(sp\)
-0+0074 <[^>]*> b	0+0000 <text_label>
-0+0078 <[^>]*> nop
-	...
+[0-9a-f]+ <[^>]*> 00000000 	nop
+[0-9a-f]+ <[^>]*> 8fbc0000 	lw	gp,0\(sp\)
+[0-9a-f]+ <[^>]*> 1000ffe2 	b	0+0000 <text_label>
+[0-9a-f]+ <[^>]*> 00000000 	nop
+	\.\.\.
Index: binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/jal-svr4pic.s
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/testsuite/gas/mips/jal-svr4pic.s	2010-07-20 00:35:38.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/jal-svr4pic.s	2010-07-20 02:38:04.000000000 +0100
@@ -1,25 +1,26 @@
 # Source file used to test the jal macro with -KPIC code.
-	
-.weak weak_text_label
 
-	.ent text_label
-text_label:	
-	.frame $sp,0,$31
+	.weak	weak_text_label
+
+	.ent	text_label
+text_label:
+	.frame	$sp, 0, $31
 	.set	noreorder
 	.cpload	$25
 	.set	reorder
 	.cprestore	0
 	jal	$25
-	jal	$4,$25
+	jal	$4, $25
 	jal	text_label
 	jal	weak_text_label
 	jal	external_text_label
 
-# Test j as well	
+# Test j as well.
 	j	text_label
 
-# Round to a 16 byte boundary, for ease in testing multiple targets.
-	nop
-	nop
+	.end	text_label
+	.size	text_label, . - text_label
 
-	.end text_label
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+	.align	2
+	.space	8



More information about the Binutils mailing list