scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit d6699d5f6615b95083b3b20250921a5c1dcfb719
parent 1b7357c51fd821de8fd48990e76fbff97077c0ae
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 12 Mar 2018 20:35:51 +0100

[test/nm] Add more tests for z80 coff32

Diffstat:
Mtests/nm/execute/0001-z80.sh | 3++-
Atests/nm/execute/0002-z80-u.sh | 16++++++++++++++++
Atests/nm/execute/0003-z80-g.sh | 28++++++++++++++++++++++++++++
Atests/nm/execute/0004-z80-v.sh | 34++++++++++++++++++++++++++++++++++
Atests/nm/execute/0005-z80-A.sh | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtests/nm/execute/Makefile | 2+-
Mtests/nm/execute/master.s | 2++
7 files changed, 159 insertions(+), 2 deletions(-)

diff --git a/tests/nm/execute/0001-z80.sh b/tests/nm/execute/0001-z80.sh @@ -28,6 +28,7 @@ cat <<! > $tmp2 0000000000000002 t text3 000000000000000a C text4 0000000000000012 C text5 + U text6 ! -cmp $tmp1 $tmp2 +diff $tmp1 $tmp2 diff --git a/tests/nm/execute/0002-z80-u.sh b/tests/nm/execute/0002-z80-u.sh @@ -0,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 diff --git a/tests/nm/execute/0003-z80-g.sh b/tests/nm/execute/0003-z80-g.sh @@ -0,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 diff --git a/tests/nm/execute/0004-z80-v.sh b/tests/nm/execute/0004-z80-v.sh @@ -0,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 diff --git a/tests/nm/execute/0005-z80-A.sh b/tests/nm/execute/0005-z80-A.sh @@ -0,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 diff --git a/tests/nm/execute/Makefile b/tests/nm/execute/Makefile @@ -9,4 +9,4 @@ tests: master.s @PATH=$(ROOTDIR)/bin:$$PATH ./chktest.sh clean: - rm -f f.s a.out test.log + rm -f *.a *.out test.log diff --git 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 @@ averylongtext: text3: .byte 0 .comm text4,10 .comm text5,18 + .short text6 .globl data1,averylongdata,data5 .data