shithub: scc

Download patch

ref: bef6a849b753fda4f626813ba542a3cb46278484
parent: 9f9c8e6fbc77dcd69e833d1d1907d4dcb60b20b3
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Mar 12 16:35:51 EDT 2018

[test/nm] Add more tests for z80 coff32

--- a/tests/nm/execute/0001-z80.sh
+++ b/tests/nm/execute/0001-z80.sh
@@ -28,6 +28,7 @@
 0000000000000002 t text3
 000000000000000a C text4
 0000000000000012 C text5
+                 U text6
 !
 
-cmp $tmp1 $tmp2
+diff $tmp1 $tmp2
--- /dev/null
+++ b/tests/nm/execute/0002-z80-u.sh
@@ -1,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f a.out $tmp1 $tmp2" 0 2 3
+
+z80-unknown-coff-as master.s
+nm -u > $tmp1
+
+cat <<! > $tmp2
+                 U text6
+!
+
+diff $tmp1 $tmp2
--- /dev/null
+++ b/tests/nm/execute/0003-z80-g.sh
@@ -1,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f a.out $tmp1 $tmp2" 0 2 3
+
+z80-unknown-coff-as master.s
+nm -g > $tmp1
+
+cat <<! > $tmp2
+0000000000000001 B averylongbss
+0000000000000001 D averylongdata
+0000000000000001 T averylongtext
+0000000000000000 B bss1
+000000000000000a C bss4
+0000000000000012 C bss5
+0000000000000000 D data1
+000000000000000a C data4
+0000000000000012 C data5
+0000000000000000 T text1
+000000000000000a C text4
+0000000000000012 C text5
+                 U text6
+!
+
+diff $tmp1 $tmp2
--- /dev/null
+++ b/tests/nm/execute/0004-z80-v.sh
@@ -1,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f a.out $tmp1 $tmp2" 0 2 3
+
+z80-unknown-coff-as master.s
+nm -v > $tmp1
+
+cat <<! > $tmp2
+                 U text6
+0000000000000000 t .text
+0000000000000000 d .data
+0000000000000000 b .bss
+0000000000000000 T text1
+0000000000000000 D data1
+0000000000000000 B bss1
+0000000000000001 T averylongtext
+0000000000000001 D averylongdata
+0000000000000001 B averylongbss
+0000000000000002 t text3
+0000000000000002 d data3
+0000000000000002 b bss3
+000000000000000a C text4
+000000000000000a C data4
+000000000000000a C bss4
+0000000000000012 C text5
+0000000000000012 C data5
+0000000000000012 C bss5
+!
+
+diff $tmp1 $tmp2
--- /dev/null
+++ b/tests/nm/execute/0005-z80-A.sh
@@ -1,0 +1,76 @@
+#!/bin/sh
+
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f a.out f.out f.a $tmp1 $tmp2" 0 2 3
+
+rm -f f.a
+z80-unknown-coff-as master.s
+ar -qv f.a a.out
+cp a.out f.out
+ar -qv f.a f.out
+nm -A f.a a.out > $tmp1
+
+cat <<! > $tmp2
+f.a[a.out]: 0000000000000000 b .bss
+f.a[a.out]: 0000000000000000 d .data
+f.a[a.out]: 0000000000000000 t .text
+f.a[a.out]: 0000000000000001 B averylongbss
+f.a[a.out]: 0000000000000001 D averylongdata
+f.a[a.out]: 0000000000000001 T averylongtext
+f.a[a.out]: 0000000000000000 B bss1
+f.a[a.out]: 0000000000000002 b bss3
+f.a[a.out]: 000000000000000a C bss4
+f.a[a.out]: 0000000000000012 C bss5
+f.a[a.out]: 0000000000000000 D data1
+f.a[a.out]: 0000000000000002 d data3
+f.a[a.out]: 000000000000000a C data4
+f.a[a.out]: 0000000000000012 C data5
+f.a[a.out]: 0000000000000000 T text1
+f.a[a.out]: 0000000000000002 t text3
+f.a[a.out]: 000000000000000a C text4
+f.a[a.out]: 0000000000000012 C text5
+f.a[a.out]:                  U text6
+f.a[f.out]: 0000000000000000 b .bss
+f.a[f.out]: 0000000000000000 d .data
+f.a[f.out]: 0000000000000000 t .text
+f.a[f.out]: 0000000000000001 B averylongbss
+f.a[f.out]: 0000000000000001 D averylongdata
+f.a[f.out]: 0000000000000001 T averylongtext
+f.a[f.out]: 0000000000000000 B bss1
+f.a[f.out]: 0000000000000002 b bss3
+f.a[f.out]: 000000000000000a C bss4
+f.a[f.out]: 0000000000000012 C bss5
+f.a[f.out]: 0000000000000000 D data1
+f.a[f.out]: 0000000000000002 d data3
+f.a[f.out]: 000000000000000a C data4
+f.a[f.out]: 0000000000000012 C data5
+f.a[f.out]: 0000000000000000 T text1
+f.a[f.out]: 0000000000000002 t text3
+f.a[f.out]: 000000000000000a C text4
+f.a[f.out]: 0000000000000012 C text5
+f.a[f.out]:                  U text6
+a.out: 0000000000000000 b .bss
+a.out: 0000000000000000 d .data
+a.out: 0000000000000000 t .text
+a.out: 0000000000000001 B averylongbss
+a.out: 0000000000000001 D averylongdata
+a.out: 0000000000000001 T averylongtext
+a.out: 0000000000000000 B bss1
+a.out: 0000000000000002 b bss3
+a.out: 000000000000000a C bss4
+a.out: 0000000000000012 C bss5
+a.out: 0000000000000000 D data1
+a.out: 0000000000000002 d data3
+a.out: 000000000000000a C data4
+a.out: 0000000000000012 C data5
+a.out: 0000000000000000 T text1
+a.out: 0000000000000002 t text3
+a.out: 000000000000000a C text4
+a.out: 0000000000000012 C text5
+a.out:                  U text6
+!
+
+diff $tmp1 $tmp2
--- a/tests/nm/execute/Makefile
+++ b/tests/nm/execute/Makefile
@@ -9,4 +9,4 @@
 	@PATH=$(ROOTDIR)/bin:$$PATH ./chktest.sh
 
 clean:
-	rm -f f.s a.out test.log
+	rm -f *.a *.out test.log
--- a/tests/nm/execute/master.s
+++ b/tests/nm/execute/master.s
@@ -1,4 +1,5 @@
 	.globl	text1,averylongtext,text5
+	.extern	text6
 	.text
 	.equ	text2,4
 text1:	.byte	0
@@ -7,6 +8,7 @@
 text3:	.byte	0
 	.comm	text4,10
 	.comm	text5,18
+	.short	text6
 
 	.globl	data1,averylongdata,data5
 	.data