This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch][gas/testsuite] Avoid name conflicts with z80 registers
- From: Arnold Metselaar <arnold dot metselaar at planet dot nl>
- To: binutils at sourceware dot org
- Date: Sun, 6 May 2012 13:37:46 +0200
- Subject: [patch][gas/testsuite] Avoid name conflicts with z80 registers
The z80 port of the assembler no longer accepts register names as ordinary symbols.
This causes some test cases with single letter identifiers like a,b,c to fail for z80.
May I apply the attached patch with the following ChangeLog entry?
Arnold
gas/testsuite/ChangeLog:
* gas/all/cond.s: Add L_ as prefix to one-letter symbols, to avoid name conflicts with z80 registers.
* gas/all/fwdexp.s: Likewise
* gas/macros/app1.s: Likewise
* gas/macros/app2.s: Likewise
* gas/macros/app3.s: Likewise
* gas/macros/app4.s: Likewise
* gas/macros/app4b.s: Likewise
* gas/all/cond.l: Adapted to expect L_ prefixes.
* gas/all/fwdexp.d: Likewise
* gas/macros/app1.d: Likewise
* gas/macros/app2.d: Likewise
* gas/macros/app3.d: Likewise
* gas/macros/app4.d: Likewise
Index: gas/all/cond.l
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/cond.l,v
retrieving revision 1.3
diff -u -r1.3 cond.l
--- gas/all/cond.l 22 Dec 2005 17:05:40 -0000 1.3
+++ gas/all/cond.l 6 May 2012 11:17:09 -0000
@@ -24,35 +24,35 @@
29[ ]+.else
31[ ]+.endif
[ ]*[1-9][0-9]*[ ]+
-[ ]*[1-9][0-9]*[ ]+\.comm[ ]+c,[ ]*1[ ]*
-[ ]*[1-9][0-9]*[ ]+\.ifndef[ ]+c[ ]*
+[ ]*[1-9][0-9]*[ ]+\.comm[ ]+L_c,[ ]*1[ ]*
+[ ]*[1-9][0-9]*[ ]+\.ifndef[ ]+L_c[ ]*
[ ]*[1-9][0-9]*[ ]+\.endif[ ]*
[ ]*[1-9][0-9]*[ ]*
-[ ]*[1-9][0-9]*[ ]+\.if[ ]+x[ ]*<>[ ]*x[ ]*
+[ ]*[1-9][0-9]*[ ]+\.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9]*[ ]+\.if[ ]+a[ ]*-[ ]*1[ ]*<>[ ]*x[ ]*
+[ ]*[1-9][0-9]*[ ]+\.if[ ]+L_a[ ]*-[ ]*1[ ]*<>[ ]*L_x[ ]*
[ ]*[1-9][0-9]*[ ]+\.endif[ ]*
-[ ]*[1-9][0-9]*[ ]+\.if[ ]+a[ ]*<>[ ]*b[ ]*\+[ ]*2[ ]*
+[ ]*[1-9][0-9]*[ ]+\.if[ ]+L_a[ ]*<>[ ]*L_b[ ]*\+[ ]*2[ ]*
[ ]*[1-9][0-9]*[ ]+\.endif[ ]*
-[ ]*[1-9][0-9]*[ ]+\.if[ ]+a[ ]*-[ ]*b[ ]*<>[ ]*2[ ]*
+[ ]*[1-9][0-9]*[ ]+\.if[ ]+L_a[ ]*-[ ]*L_b[ ]*<>[ ]*2[ ]*
[ ]*[1-9][0-9]*[ ]+\.endif[ ]*
[ ]*[1-9][0-9]*[ ]*
-[ ]*[1-9][0-9]*[ ]+\.equiv[ ]+x,[ ]*0[ ]*
-[ ]*[1-9][0-9]*[ ]+\.if[ ]+y[ ]*
-[ ]*[1-9][0-9]*[ ]+\.elseif[ ]+y[ ]*
+[ ]*[1-9][0-9]*[ ]+\.equiv[ ]+L_x,[ ]*0[ ]*
+[ ]*[1-9][0-9]*[ ]+\.if[ ]+L_y[ ]*
+[ ]*[1-9][0-9]*[ ]+\.elseif[ ]+L_y[ ]*
[ ]*[1-9][0-9]*[ ]+\.endif[ ]*
[ ]*[1-9][0-9]*[ ]+
[ ]*[1-9][0-9]*[ ]+\.macro[ ]+m[ ]+x,[ ]*y[ ]*
Index: gas/all/cond.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/cond.s,v
retrieving revision 1.6
diff -u -r1.6 cond.s
--- gas/all/cond.s 22 Dec 2005 17:05:40 -0000 1.6
+++ gas/all/cond.s 6 May 2012 11:17:09 -0000
@@ -30,45 +30,45 @@
.long 9
.endif
- .comm c, 1
- .ifndef c
+ .comm L_c, 1
+ .ifndef L_c
.err
.endif
- .if x <> x
+ .if L_x <> L_x
.err
.endif
- .equiv y, x
- .ifndef y
+ .equiv L_y, L_x
+ .ifndef L_y
.err
.endif
- .if x <> y
+ .if L_x <> L_y
.err
.endif
- .equiv z, x
- .if y <> z
+ .equiv L_z, L_x
+ .if L_y <> L_z
.err
.endif
- .equiv a, y + 1
- .equiv b, z - 1
- .if a == x
+ .equiv L_a, L_y + 1
+ .equiv L_b, L_z - 1
+ .if L_a == L_x
.err
.endif
- .if a - 1 <> x
+ .if L_a - 1 <> L_x
.err
.endif
- .if a <> b + 2
+ .if L_a <> L_b + 2
.err
.endif
- .if a - b <> 2
+ .if L_a - L_b <> 2
.err
.endif
- .equiv x, 0
- .if y
+ .equiv L_x, 0
+ .if L_y
.err
- .elseif y
+ .elseif L_y
.err
.endif
Index: gas/all/fwdexp.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/fwdexp.d,v
retrieving revision 1.2
diff -u -r1.2 fwdexp.d
--- gas/all/fwdexp.d 22 Oct 2010 08:13:58 -0000 1.2
+++ gas/all/fwdexp.d 6 May 2012 11:17:09 -0000
@@ -5,7 +5,7 @@
RELOCATION RECORDS FOR .*
OFFSET +TYPE +VALUE
-0+ .*(\.data|i)(|\+0xf+e|\+0xf+c|\+0xf+8)
+0+ .*(\.data|L_i)(|\+0xf+e|\+0xf+c|\+0xf+8)
Contents of section .*
0+ (0+|feff|fffe|fcffffff|fffffffc|f8ffffff|f8ffffff ffffffff|ffffffff fffffff8) .*
Index: gas/all/fwdexp.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/fwdexp.s,v
retrieving revision 1.1
diff -u -r1.1 fwdexp.s
--- gas/all/fwdexp.s 29 Sep 2010 06:49:33 -0000 1.1
+++ gas/all/fwdexp.s 6 May 2012 11:17:09 -0000
@@ -1,6 +1,6 @@
.data
-i:
+L_i:
.text
- .dc.a i + (. - .L1)
+ .dc.a L_i + (. - .L1)
.L1:
Index: gas/macros/app1.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/macros/app1.d,v
retrieving revision 1.4
diff -u -r1.4 app1.d
--- gas/macros/app1.d 18 Apr 2011 13:44:36 -0000 1.4
+++ gas/macros/app1.d 6 May 2012 11:17:09 -0000
@@ -1,7 +1,7 @@
#nm: -n
#name: APP with macro without NO_APP
#...
-0+ T a
+0+ T L_a
#...
-0+[1-f] T b
+0+[1-f] T L_b
#pass
Index: gas/macros/app1.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/macros/app1.s,v
retrieving revision 1.2
diff -u -r1.2 app1.s
--- gas/macros/app1.s 18 Apr 2011 13:44:36 -0000 1.2
+++ gas/macros/app1.s 6 May 2012 11:17:09 -0000
@@ -1,12 +1,12 @@
#NO_APP
.text
.macro foo
- .globl a
-a:
+ .globl L_a
+L_a:
.long 42
.endm
#APP
foo
- .globl b
-b:
+ .globl L_b
+L_b:
.long 56
Index: gas/macros/app2.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/macros/app2.d,v
retrieving revision 1.4
diff -u -r1.4 app2.d
--- gas/macros/app2.d 18 Apr 2011 13:44:36 -0000 1.4
+++ gas/macros/app2.d 6 May 2012 11:17:09 -0000
@@ -1,7 +1,7 @@
#nm: -n
#name: APP with macro then NO_APP
#...
-0+ T a
+0+ T L_a
#...
-0+[1-f] T b
+0+[1-f] T L_b
#pass
Index: gas/macros/app2.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/macros/app2.s,v
retrieving revision 1.2
diff -u -r1.2 app2.s
--- gas/macros/app2.s 18 Apr 2011 13:44:36 -0000 1.2
+++ gas/macros/app2.s 6 May 2012 11:17:09 -0000
@@ -1,13 +1,13 @@
#NO_APP
.text
.macro foo
- .globl a
-a:
+ .globl L_a
+L_a:
.long 42
.endm
#APP
foo
- .globl b
-b:
+ .globl L_b
+L_b:
.long 56
#NO_APP
Index: gas/macros/app3.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/macros/app3.d,v
retrieving revision 1.4
diff -u -r1.4 app3.d
--- gas/macros/app3.d 18 Apr 2011 13:44:36 -0000 1.4
+++ gas/macros/app3.d 6 May 2012 11:17:09 -0000
@@ -1,9 +1,9 @@
#nm: -n
#name: APP with macro then NO_APP then more code
#...
-0+ T a
+0+ T L_a
#...
-0+[1-f] T b
+0+[1-f] T L_b
#...
-0+[2-f] T c
+0+[2-f] T L_c
#pass
Index: gas/macros/app3.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/macros/app3.s,v
retrieving revision 1.2
diff -u -r1.2 app3.s
--- gas/macros/app3.s 18 Apr 2011 13:44:36 -0000 1.2
+++ gas/macros/app3.s 6 May 2012 11:17:09 -0000
@@ -1,16 +1,16 @@
#NO_APP
.text
.macro foo
- .globl a
-a:
+ .globl L_a
+L_a:
.long 42
.endm
#APP
foo
- .globl b
-b:
+ .globl L_b
+L_b:
.long 56
#NO_APP
- .globl c
-c:
+ .globl L_c
+L_c:
.long 78
Index: gas/macros/app4.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/macros/app4.d,v
retrieving revision 1.4
diff -u -r1.4 app4.d
--- gas/macros/app4.d 18 Apr 2011 13:44:36 -0000 1.4
+++ gas/macros/app4.d 6 May 2012 11:17:09 -0000
@@ -2,9 +2,9 @@
#nm: -n
#name: included file with .if 0 wrapped in APP/NO_APP, no final NO_APP, macro in main file
#...
-0+ T d
+0+ T L_d
#...
-0+[1-f] T a
+0+[1-f] T L_a
#...
-0+[2-f] T b
+0+[2-f] T L_b
#pass
Index: gas/macros/app4.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/macros/app4.s,v
retrieving revision 1.2
diff -u -r1.2 app4.s
--- gas/macros/app4.s 18 Apr 2011 13:44:36 -0000 1.2
+++ gas/macros/app4.s 6 May 2012 11:17:09 -0000
@@ -1,11 +1,11 @@
.text
.macro foo
- .globl a
-a:
+ .globl L_a
+L_a:
.long 42
.endm
.include "app4b.s"
foo
- .globl b
-b:
+ .globl L_b
+L_b:
.long 56
Index: gas/macros/app4b.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/macros/app4b.s,v
retrieving revision 1.2
diff -u -r1.2 app4b.s
--- gas/macros/app4b.s 18 Apr 2011 13:44:36 -0000 1.2
+++ gas/macros/app4b.s 6 May 2012 11:17:09 -0000
@@ -1,12 +1,12 @@
#NO_APP
- .globl d
-d:
+ .globl L_d
+L_d:
.long 21
#APP
.if 0
#NO_APP
.err
- .globl x
-x:
+ .globl L_x
+L_x:
#APP
.endif