@@@ tests: ARCH var in non-Knight scripts

This commit is contained in:
deesix 2021-01-31 00:00:00 +01:00
parent 6bb784eae5
commit ab055a8823
132 changed files with 1865 additions and 1601 deletions

View File

@ -18,41 +18,43 @@
set -x
TMPDIR="test/test0000/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0000/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
--architecture ${ARCH} \
-f test/test0000/return.c \
-o ${TMPDIR}/return.M1 \
|| exit 1
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-core.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-core.M1 \
-f ${TMPDIR}/return.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0000-aarch64-binary \
-o test/results/test0000-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0000-aarch64-binary
./test/results/test0000-${ARCH}-binary
[ 42 = $? ] || exit 4
fi
exit 0

View File

@ -18,41 +18,43 @@
set -x
TMPDIR="test/test0000/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0000/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
--architecture ${ARCH} \
-f test/test0000/return.c \
-o ${TMPDIR}/return.M1 \
|| exit 1
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-core.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-core.M1 \
-f ${TMPDIR}/return.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0000-amd64-binary \
-o test/results/test0000-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0000-amd64-binary
./test/results/test0000-${ARCH}-binary
[ 42 = $? ] || exit 3
fi
exit 0

View File

@ -18,41 +18,43 @@
set -x
TMPDIR="test/test0000/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0000/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
--architecture ${ARCH} \
-f test/test0000/return.c \
-o ${TMPDIR}/return.M1 \
|| exit 1
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-core.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-core.M1 \
-f ${TMPDIR}/return.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0000-armv7l-binary \
-o test/results/test0000-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0000-armv7l-binary
./test/results/test0000-${ARCH}-binary
[ 42 = $? ] || exit 3
fi
exit 0

View File

@ -18,41 +18,43 @@
set -x
TMPDIR="test/test0000/tmp-x86"
ARCH="x86"
TMPDIR="test/test0000/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
--architecture ${ARCH} \
-f test/test0000/return.c \
-o ${TMPDIR}/return.M1 \
|| exit 1
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-core.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-core.M1 \
-f ${TMPDIR}/return.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0000-x86-binary \
-o test/results/test0000-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0000-x86-binary
./test/results/test0000-${ARCH}-binary
[ 42 = $? ] || exit 3
fi
exit 0

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0001/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0001/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0001/library_call.c \
-o ${TMPDIR}/library_call.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/library_call.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/library_call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/library_call.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0001-aarch64-binary \
-o test/results/test0001-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0001-aarch64-binary 2>&1)
out=$(./test/results/test0001-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 3
[ "$out" = "Hello mes" ] || exit 4
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0001/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0001/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0001/library_call.c \
-o ${TMPDIR}/library_call.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/library_call.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/library_call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/library_call.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0001-amd64-binary \
-o test/results/test0001-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0001-amd64-binary 2>&1)
out=$(./test/results/test0001-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 3
[ "$out" = "Hello mes" ] || exit 4
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0001/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0001/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0001/library_call.c \
-o ${TMPDIR}/library_call.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/library_call.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/library_call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/library_call.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0001-armv7l-binary \
-o test/results/test0001-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0001-armv7l-binary 2>&1)
out=$(./test/results/test0001-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 3
[ "$out" = "Hello mes" ] || exit 4
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0001/tmp-x86"
ARCH="x86"
TMPDIR="test/test0001/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0001/library_call.c \
-o ${TMPDIR}/library_call.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/library_call.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/library_call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/library_call.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0001-x86-binary \
-o test/results/test0001-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0001-x86-binary 2>&1)
out=$(./test/results/test0001-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 3
[ "$out" = "Hello mes" ] || exit 4
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0002/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0002/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0002/if.c \
-o ${TMPDIR}/if.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/if.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/if.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/if.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0002-aarch64-binary \
-o test/results/test0002-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0002-aarch64-binary 2>&1)
out=$(./test/results/test0002-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0002/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0002/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0002/if.c \
-o ${TMPDIR}/if.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/if.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/if.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/if.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0002-amd64-binary \
-o test/results/test0002-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0002-amd64-binary 2>&1 )
out=$(./test/results/test0002-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0002/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0002/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0002/if.c \
-o ${TMPDIR}/if.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/if.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/if.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/if.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0002-armv7l-binary \
-o test/results/test0002-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0002-armv7l-binary 2>&1 )
out=$(./test/results/test0002-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0002/tmp-x86"
ARCH="x86"
TMPDIR="test/test0002/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0002/if.c \
-o ${TMPDIR}/if.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/if.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/if.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/if.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0002-x86-binary \
-o test/results/test0002-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0002-x86-binary 2>&1 )
out=$(./test/results/test0002-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0003/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0003/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0003/constant.c \
-o ${TMPDIR}/constant.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/constant.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/constant.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/constant.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0003-aarch64-binary \
-o test/results/test0003-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0003-aarch64-binary 2>&1)
out=$(./test/results/test0003-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0003/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0003/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0003/constant.c \
-o ${TMPDIR}/constant.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/constant.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/constant.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/constant.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0003-amd64-binary \
-o test/results/test0003-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0003-amd64-binary 2>&1 )
out=$(./test/results/test0003-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0003/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0003/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0003/constant.c \
-o ${TMPDIR}/constant.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/constant.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/constant.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/constant.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0003-armv7l-binary \
-o test/results/test0003-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0003-armv7l-binary 2>&1 )
out=$(./test/results/test0003-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0003/tmp-x86"
ARCH="x86"
TMPDIR="test/test0003/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0003/constant.c \
-o ${TMPDIR}/constant.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/constant.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/constant.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/constant.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0003-x86-binary \
-o test/results/test0003-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0003-x86-binary 2>&1 )
out=$(./test/results/test0003-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0004/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0004/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0004/call.c \
-o ${TMPDIR}/call.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/call.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/call.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0004-aarch64-binary \
-o test/results/test0004-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0004-aarch64-binary 2>&1)
out=$(./test/results/test0004-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0004/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0004/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0004/call.c \
-o ${TMPDIR}/call.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/call.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/call.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0004-amd64-binary \
-o test/results/test0004-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0004-amd64-binary 2>&1 )
out=$(./test/results/test0004-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0004/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0004/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0004/call.c \
-o ${TMPDIR}/call.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/call.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/call.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0004-armv7l-binary \
-o test/results/test0004-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0004-armv7l-binary 2>&1 )
out=$(./test/results/test0004-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0004/tmp-x86"
ARCH="x86"
TMPDIR="test/test0004/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0004/call.c \
-o ${TMPDIR}/call.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/call.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/call.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0004-x86-binary \
-o test/results/test0004-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0004-x86-binary 2>&1 )
out=$(./test/results/test0004-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0005/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0005/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0005/string.c \
-o ${TMPDIR}/string.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/string.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/string.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/string.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0005-aarch64-binary \
-o test/results/test0005-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0005-aarch64-binary 2>&1)
out=$(./test/results/test0005-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0005/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0005/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0005/string.c \
-o ${TMPDIR}/string.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/string.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/string.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/string.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0005-amd64-binary \
-o test/results/test0005-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0005-amd64-binary 2>&1 )
out=$(./test/results/test0005-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0005/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0005/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0005/string.c \
-o ${TMPDIR}/string.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/string.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/string.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/string.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0005-armv7l-binary \
-o test/results/test0005-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0005-armv7l-binary 2>&1 )
out=$(./test/results/test0005-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0005/tmp-x86"
ARCH="x86"
TMPDIR="test/test0005/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0005/string.c \
-o ${TMPDIR}/string.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/string.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/string.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/string.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0005-x86-binary \
-o test/results/test0005-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0005-x86-binary 2>&1 )
out=$(./test/results/test0005-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0006/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0006/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0006/for.c \
-o ${TMPDIR}/for.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/for.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/for.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0006-aarch64-binary \
-o test/results/test0006-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0006-aarch64-binary >| test/test0006/proof || exit 4
./test/results/test0006-${ARCH}-binary >| test/test0006/proof || exit 4
out=$(sha256_check test/test0006/proof.answer)
[ "$out" = "test/test0006/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0006/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0006/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0006/for.c \
-o ${TMPDIR}/for.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/for.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/for.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0006-amd64-binary \
-o test/results/test0006-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0006-amd64-binary >| test/test0006/proof || exit 4
./test/results/test0006-${ARCH}-binary >| test/test0006/proof || exit 4
out=$(sha256_check test/test0006/proof.answer)
[ "$out" = "test/test0006/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0006/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0006/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0006/for.c \
-o ${TMPDIR}/for.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/for.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/for.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0006-armv7l-binary \
-o test/results/test0006-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0006-armv7l-binary >| test/test0006/proof || exit 4
./test/results/test0006-${ARCH}-binary >| test/test0006/proof || exit 4
out=$(sha256_check test/test0006/proof.answer)
[ "$out" = "test/test0006/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0006/tmp-x86"
ARCH="x86"
TMPDIR="test/test0006/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0006/for.c \
-o ${TMPDIR}/for.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/for.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/for.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0006-x86-binary \
-o test/results/test0006-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0006-x86-binary >| test/test0006/proof || exit 4
./test/results/test0006-${ARCH}-binary >| test/test0006/proof || exit 4
out=$(sha256_check test/test0006/proof.answer)
[ "$out" = "test/test0006/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0007/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0007/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0007/do.c \
-o ${TMPDIR}/do.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/do.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/do.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0007-aarch64-binary \
-o test/results/test0007-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0007-aarch64-binary >| test/test0007/proof || exit 4
./test/results/test0007-${ARCH}-binary >| test/test0007/proof || exit 4
out=$(sha256_check test/test0007/proof.answer)
[ "$out" = "test/test0007/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0007/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0007/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0007/do.c \
-o ${TMPDIR}/do.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/do.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/do.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0007-amd64-binary \
-o test/results/test0007-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0007-amd64-binary >| test/test0007/proof || exit 4
./test/results/test0007-${ARCH}-binary >| test/test0007/proof || exit 4
out=$(sha256_check test/test0007/proof.answer)
[ "$out" = "test/test0007/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0007/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0007/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0007/do.c \
-o ${TMPDIR}/do.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/do.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/do.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0007-armv7l-binary \
-o test/results/test0007-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0007-armv7l-binary >| test/test0007/proof || exit 4
./test/results/test0007-${ARCH}-binary >| test/test0007/proof || exit 4
out=$(sha256_check test/test0007/proof.answer)
[ "$out" = "test/test0007/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0007/tmp-x86"
ARCH="x86"
TMPDIR="test/test0007/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0007/do.c \
-o ${TMPDIR}/do.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/do.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/do.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0007-x86-binary \
-o test/results/test0007-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0007-x86-binary >| test/test0007/proof || exit 4
./test/results/test0007-${ARCH}-binary >| test/test0007/proof || exit 4
out=$(sha256_check test/test0007/proof.answer)
[ "$out" = "test/test0007/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0008/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0008/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0008/struct.c \
--debug \
@ -43,30 +45,30 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
-f ${TMPDIR}/struct-footer.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0008-aarch64-binary \
-o test/results/test0008-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0008-aarch64-binary 2>&1 )
out=$(./test/results/test0008-${ARCH}-binary 2>&1 )
[ 32 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0008/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0008/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0008/struct.c \
--debug \
@ -43,30 +45,30 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
-f ${TMPDIR}/struct-footer.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0008-amd64-binary \
-o test/results/test0008-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0008-amd64-binary 2>&1 )
out=$(./test/results/test0008-${ARCH}-binary 2>&1 )
[ 32 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0008/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0008/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0008/struct.c \
--debug \
@ -42,30 +44,30 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
-f ${TMPDIR}/struct-footer.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0008-armv7l-binary \
-o test/results/test0008-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0008-armv7l-binary 2>&1 )
out=$(./test/results/test0008-${ARCH}-binary 2>&1 )
[ 16 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0008/tmp-x86"
ARCH="x86"
TMPDIR="test/test0008/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0008/struct.c \
--debug \
@ -42,30 +44,30 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
-f ${TMPDIR}/struct-footer.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0008-x86-binary \
-o test/results/test0008-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0008-x86-binary 2>&1 )
out=$(./test/results/test0008-${ARCH}-binary 2>&1 )
[ 16 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0009/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0009/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0009/goto.c \
-o ${TMPDIR}/goto.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/goto.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/goto.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/goto.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0009-aarch64-binary \
-o test/results/test0009-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0009-aarch64-binary 2>&1 )
out=$(./test/results/test0009-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0009/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0009/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0009/goto.c \
-o ${TMPDIR}/goto.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/goto.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/goto.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/goto.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0009-amd64-binary \
-o test/results/test0009-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0009-amd64-binary 2>&1 )
out=$(./test/results/test0009-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0009/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0009/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0009/goto.c \
-o ${TMPDIR}/goto.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/goto.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/goto.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/goto.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0009-armv7l-binary \
-o test/results/test0009-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0009-armv7l-binary 2>&1 )
out=$(./test/results/test0009-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0009/tmp-x86"
ARCH="x86"
TMPDIR="test/test0009/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0009/goto.c \
-o ${TMPDIR}/goto.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/goto.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/goto.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/goto.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0009-x86-binary \
-o test/results/test0009-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0009-x86-binary 2>&1 )
out=$(./test/results/test0009-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0010/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0010/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0010/nested_struct.c \
-o ${TMPDIR}/nested_struct.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/nested_struct.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/nested_struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/nested_struct.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0010-aarch64-binary \
-o test/results/test0010-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0010-aarch64-binary 2>&1 )
out=$(./test/results/test0010-${ARCH}-binary 2>&1 )
[ 24 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0010/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0010/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0010/nested_struct.c \
-o ${TMPDIR}/nested_struct.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/nested_struct.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/nested_struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/nested_struct.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0010-amd64-binary \
-o test/results/test0010-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0010-amd64-binary 2>&1 )
out=$(./test/results/test0010-${ARCH}-binary 2>&1 )
[ 24 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0010/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0010/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0010/nested_struct.c \
-o ${TMPDIR}/nested_struct.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/nested_struct.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/nested_struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/nested_struct.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0010-armv7l-binary \
-o test/results/test0010-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0010-armv7l-binary 2>&1 )
out=$(./test/results/test0010-${ARCH}-binary 2>&1 )
[ 12 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0010/tmp-x86"
ARCH="x86"
TMPDIR="test/test0010/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0010/nested_struct.c \
-o ${TMPDIR}/nested_struct.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/nested_struct.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/nested_struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/nested_struct.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0010-x86-binary \
-o test/results/test0010-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0010-x86-binary 2>&1 )
out=$(./test/results/test0010-${ARCH}-binary 2>&1 )
[ 12 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0011/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0011/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0011/break-do.c \
-o ${TMPDIR}/break-do.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-do.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/break-do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-do.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0011-aarch64-binary \
-o test/results/test0011-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0011-aarch64-binary >| test/test0011/proof || exit 4
./test/results/test0011-${ARCH}-binary >| test/test0011/proof || exit 4
out=$(sha256_check test/test0011/proof.answer)
[ "$out" = "test/test0011/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0011/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0011/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0011/break-do.c \
-o ${TMPDIR}/break-do.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-do.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/break-do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-do.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0011-amd64-binary \
-o test/results/test0011-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0011-amd64-binary >| test/test0011/proof || exit 4
./test/results/test0011-${ARCH}-binary >| test/test0011/proof || exit 4
out=$(sha256_check test/test0011/proof.answer)
[ "$out" = "test/test0011/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0011/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0011/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0011/break-do.c \
-o ${TMPDIR}/break-do.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-do.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/break-do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-do.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0011-armv7l-binary \
-o test/results/test0011-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0011-armv7l-binary >| test/test0011/proof || exit 4
./test/results/test0011-${ARCH}-binary >| test/test0011/proof || exit 4
out=$(sha256_check test/test0011/proof.answer)
[ "$out" = "test/test0011/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0011/tmp-x86"
ARCH="x86"
TMPDIR="test/test0011/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0011/break-do.c \
-o ${TMPDIR}/break-do.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-do.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/break-do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-do.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0011-x86-binary \
-o test/results/test0011-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0011-x86-binary >| test/test0011/proof || exit 4
./test/results/test0011-${ARCH}-binary >| test/test0011/proof || exit 4
out=$(sha256_check test/test0011/proof.answer)
[ "$out" = "test/test0011/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0012/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0012/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0012/break-for.c \
-o ${TMPDIR}/break-for.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-for.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/break-for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-for.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0012-aarch64-binary \
-o test/results/test0012-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0012-aarch64-binary >| test/test0012/proof || exit 4
./test/results/test0012-${ARCH}-binary >| test/test0012/proof || exit 4
out=$(sha256_check test/test0012/proof.answer)
[ "$out" = "test/test0012/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0012/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0012/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0012/break-for.c \
-o ${TMPDIR}/break-for.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-for.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/break-for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-for.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0012-amd64-binary \
-o test/results/test0012-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0012-amd64-binary >| test/test0012/proof || exit 4
./test/results/test0012-${ARCH}-binary >| test/test0012/proof || exit 4
out=$(sha256_check test/test0012/proof.answer)
[ "$out" = "test/test0012/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0012/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0012/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0012/break-for.c \
-o ${TMPDIR}/break-for.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-for.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/break-for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-for.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0012-armv7l-binary \
-o test/results/test0012-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0012-armv7l-binary >| test/test0012/proof || exit 4
./test/results/test0012-${ARCH}-binary >| test/test0012/proof || exit 4
out=$(sha256_check test/test0012/proof.answer)
[ "$out" = "test/test0012/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0012/tmp-x86"
ARCH="x86"
TMPDIR="test/test0012/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0012/break-for.c \
-o ${TMPDIR}/break-for.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-for.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/break-for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-for.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0012-x86-binary \
-o test/results/test0012-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0012-x86-binary >| test/test0012/proof || exit 4
./test/results/test0012-${ARCH}-binary >| test/test0012/proof || exit 4
out=$(sha256_check test/test0012/proof.answer)
[ "$out" = "test/test0012/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0013/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0013/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0013/break-while.c \
-o ${TMPDIR}/break-while.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-while.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/break-while.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-while.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0013-aarch64-binary \
-o test/results/test0013-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0013-aarch64-binary >| test/test0013/proof || exit 4
./test/results/test0013-${ARCH}-binary >| test/test0013/proof || exit 4
out=$(sha256_check test/test0013/proof.answer)
[ "$out" = "test/test0013/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0013/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0013/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0013/break-while.c \
-o ${TMPDIR}/break-while.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-while.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/break-while.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-while.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0013-amd64-binary \
-o test/results/test0013-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0013-amd64-binary >| test/test0013/proof || exit 4
./test/results/test0013-${ARCH}-binary >| test/test0013/proof || exit 4
out=$(sha256_check test/test0013/proof.answer)
[ "$out" = "test/test0013/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0013/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0013/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0013/break-while.c \
-o ${TMPDIR}/break-while.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-while.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/break-while.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-while.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0013-armv7l-binary \
-o test/results/test0013-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0013-armv7l-binary >| test/test0013/proof || exit 4
./test/results/test0013-${ARCH}-binary >| test/test0013/proof || exit 4
out=$(sha256_check test/test0013/proof.answer)
[ "$out" = "test/test0013/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0013/tmp-x86"
ARCH="x86"
TMPDIR="test/test0013/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0013/break-while.c \
-o ${TMPDIR}/break-while.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/break-while.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/break-while.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/break-while.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0013-x86-binary \
-o test/results/test0013-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0013-x86-binary >| test/test0013/proof || exit 4
./test/results/test0013-${ARCH}-binary >| test/test0013/proof || exit 4
out=$(sha256_check test/test0013/proof.answer)
[ "$out" = "test/test0013/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0014/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0014/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0014/basic_args.c \
-o ${TMPDIR}/basic_args.M1 \
@ -34,31 +36,31 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/basic_args.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/basic_args.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/basic_args.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0014-aarch64-binary \
-o test/results/test0014-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0014-aarch64-binary 314 1 5926 5 35897 932384626 43 383279 50288 419 71693 99375105 820974944 >| test/test0014/proof || exit 4
out=$(sha256_check test/test0014/proof-aarch64.answer)
./test/results/test0014-${ARCH}-binary 314 1 5926 5 35897 932384626 43 383279 50288 419 71693 99375105 820974944 >| test/test0014/proof || exit 4
out=$(sha256_check test/test0014/proof-${ARCH}.answer)
[ "$out" = "test/test0014/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0014/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0014/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0014/basic_args.c \
-o ${TMPDIR}/basic_args.M1 \
@ -34,31 +36,31 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/basic_args.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/basic_args.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/basic_args.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0014-amd64-binary \
-o test/results/test0014-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0014-amd64-binary 314 1 5926 5 35897 932384626 43 383279 50288 419 71693 99375105 820974944 >| test/test0014/proof || exit 4
out=$(sha256_check test/test0014/proof-amd64.answer)
./test/results/test0014-${ARCH}-binary 314 1 5926 5 35897 932384626 43 383279 50288 419 71693 99375105 820974944 >| test/test0014/proof || exit 4
out=$(sha256_check test/test0014/proof-${ARCH}.answer)
[ "$out" = "test/test0014/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0014/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0014/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0014/basic_args.c \
-o ${TMPDIR}/basic_args.M1 \
@ -34,31 +36,31 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/basic_args.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/basic_args.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/basic_args.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0014-armv7l-binary \
-o test/results/test0014-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0014-armv7l-binary 314 1 5926 5 35897 932384626 43 383279 50288 419 71693 99375105 820974944 >| test/test0014/proof || exit 4
out=$(sha256_check test/test0014/proof-armv7l.answer)
./test/results/test0014-${ARCH}-binary 314 1 5926 5 35897 932384626 43 383279 50288 419 71693 99375105 820974944 >| test/test0014/proof || exit 4
out=$(sha256_check test/test0014/proof-${ARCH}.answer)
[ "$out" = "test/test0014/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0014/tmp-x86"
ARCH="x86"
TMPDIR="test/test0014/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0014/basic_args.c \
-o ${TMPDIR}/basic_args.M1 \
@ -34,31 +36,31 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/basic_args.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/basic_args.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/basic_args.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0014-x86-binary \
-o test/results/test0014-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0014-x86-binary 314 1 5926 5 35897 932384626 43 383279 50288 419 71693 99375105 820974944 >| test/test0014/proof || exit 4
out=$(sha256_check test/test0014/proof-x86.answer)
./test/results/test0014-${ARCH}-binary 314 1 5926 5 35897 932384626 43 383279 50288 419 71693 99375105 820974944 >| test/test0014/proof || exit 4
out=$(sha256_check test/test0014/proof-${ARCH}.answer)
[ "$out" = "test/test0014/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0015/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0015/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0015/file_read.c \
-o ${TMPDIR}/file_read.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/file_read.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/file_read.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/file_read.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0015-aarch64-binary \
-o test/results/test0015-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0015-aarch64-binary test/test0015/file_read.c >| test/test0015/proof || exit 4
./test/results/test0015-${ARCH}-binary test/test0015/file_read.c >| test/test0015/proof || exit 4
out=$(sha256_check test/test0015/proof.answer)
[ "$out" = "test/test0015/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0015/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0015/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0015/file_read.c \
-o ${TMPDIR}/file_read.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/file_read.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/file_read.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/file_read.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0015-amd64-binary \
-o test/results/test0015-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0015-amd64-binary test/test0015/file_read.c >| test/test0015/proof || exit 4
./test/results/test0015-${ARCH}-binary test/test0015/file_read.c >| test/test0015/proof || exit 4
out=$(sha256_check test/test0015/proof.answer)
[ "$out" = "test/test0015/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0015/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0015/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0015/file_read.c \
-o ${TMPDIR}/file_read.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/file_read.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/file_read.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/file_read.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0015-armv7l-binary \
-o test/results/test0015-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0015-armv7l-binary test/test0015/file_read.c >| test/test0015/proof || exit 4
./test/results/test0015-${ARCH}-binary test/test0015/file_read.c >| test/test0015/proof || exit 4
out=$(sha256_check test/test0015/proof.answer)
[ "$out" = "test/test0015/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0015/tmp-x86"
ARCH="x86"
TMPDIR="test/test0015/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0015/file_read.c \
-o ${TMPDIR}/file_read.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/file_read.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/file_read.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/file_read.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0015-x86-binary \
-o test/results/test0015-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0015-x86-binary test/test0015/file_read.c >| test/test0015/proof || exit 4
./test/results/test0015-${ARCH}-binary test/test0015/file_read.c >| test/test0015/proof || exit 4
out=$(sha256_check test/test0015/proof.answer)
[ "$out" = "test/test0015/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0016/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0016/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0016/file_write.c \
-o ${TMPDIR}/file_write.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/file_write.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/file_write.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/file_write.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0016-aarch64-binary \
-o test/results/test0016-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0016-aarch64-binary test/test0016/proof || exit 4
./test/results/test0016-${ARCH}-binary test/test0016/proof || exit 4
out=$(sha256_check test/test0016/proof.answer)
[ "$out" = "test/test0016/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0016/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0016/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0016/file_write.c \
-o ${TMPDIR}/file_write.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/file_write.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/file_write.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/file_write.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0016-amd64-binary \
-o test/results/test0016-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0016-amd64-binary test/test0016/proof || exit 4
./test/results/test0016-${ARCH}-binary test/test0016/proof || exit 4
out=$(sha256_check test/test0016/proof.answer)
[ "$out" = "test/test0016/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0016/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0016/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0016/file_write.c \
-o ${TMPDIR}/file_write.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/file_write.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/file_write.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/file_write.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0016-armv7l-binary \
-o test/results/test0016-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0016-armv7l-binary test/test0016/proof || exit 4
./test/results/test0016-${ARCH}-binary test/test0016/proof || exit 4
out=$(sha256_check test/test0016/proof.answer)
[ "$out" = "test/test0016/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0016/tmp-x86"
ARCH="x86"
TMPDIR="test/test0016/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0016/file_write.c \
-o ${TMPDIR}/file_write.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/file_write.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/file_write.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/file_write.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0016-x86-binary \
-o test/results/test0016-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0016-x86-binary test/test0016/proof || exit 4
./test/results/test0016-${ARCH}-binary test/test0016/proof || exit 4
out=$(sha256_check test/test0016/proof.answer)
[ "$out" = "test/test0016/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0017/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0017/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0017/memset.c \
-o ${TMPDIR}/memset.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/memset.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/memset.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/memset.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0017-aarch64-binary \
-o test/results/test0017-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0017-aarch64-binary >| test/test0017/proof || exit 4
./test/results/test0017-${ARCH}-binary >| test/test0017/proof || exit 4
out=$(sha256_check test/test0017/proof.answer)
[ "$out" = "test/test0017/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0017/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0017/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0017/memset.c \
-o ${TMPDIR}/memset.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/memset.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/memset.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/memset.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0017-amd64-binary \
-o test/results/test0017-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0017-amd64-binary >| test/test0017/proof || exit 4
./test/results/test0017-${ARCH}-binary >| test/test0017/proof || exit 4
out=$(sha256_check test/test0017/proof.answer)
[ "$out" = "test/test0017/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0017/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0017/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0017/memset.c \
-o ${TMPDIR}/memset.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/memset.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/memset.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/memset.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0017-armv7l-binary \
-o test/results/test0017-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0017-armv7l-binary >| test/test0017/proof || exit 4
./test/results/test0017-${ARCH}-binary >| test/test0017/proof || exit 4
out=$(sha256_check test/test0017/proof.answer)
[ "$out" = "test/test0017/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0017/tmp-x86"
ARCH="x86"
TMPDIR="test/test0017/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0017/memset.c \
-o ${TMPDIR}/memset.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/memset.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/memset.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/memset.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0017-x86-binary \
-o test/results/test0017-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0017-x86-binary >| test/test0017/proof || exit 4
./test/results/test0017-${ARCH}-binary >| test/test0017/proof || exit 4
out=$(sha256_check test/test0017/proof.answer)
[ "$out" = "test/test0017/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0018/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0018/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0018/math.c \
-o ${TMPDIR}/math.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/math.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/math.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/math.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0018-aarch64-binary \
-o test/results/test0018-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0018-aarch64-binary >| test/test0018/proof || exit 4
./test/results/test0018-${ARCH}-binary >| test/test0018/proof || exit 4
out=$(sha256_check test/test0018/proof.answer)
[ "$out" = "test/test0018/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0018/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0018/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0018/math.c \
-o ${TMPDIR}/math.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/math.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/math.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/math.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0018-amd64-binary \
-o test/results/test0018-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0018-amd64-binary >| test/test0018/proof || exit 4
./test/results/test0018-${ARCH}-binary >| test/test0018/proof || exit 4
out=$(sha256_check test/test0018/proof.answer)
[ "$out" = "test/test0018/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0018/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0018/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0018/math.c \
-o ${TMPDIR}/math.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/math.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/math.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/math.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0018-armv7l-binary \
-o test/results/test0018-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0018-armv7l-binary >| test/test0018/proof || exit 4
./test/results/test0018-${ARCH}-binary >| test/test0018/proof || exit 4
out=$(sha256_check test/test0018/proof.answer)
[ "$out" = "test/test0018/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0018/tmp-x86"
ARCH="x86"
TMPDIR="test/test0018/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0018/math.c \
-o ${TMPDIR}/math.M1 \
@ -34,30 +36,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/math.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/math.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/math.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0018-x86-binary \
-o test/results/test0018-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0018-x86-binary >| test/test0018/proof || exit 4
./test/results/test0018-${ARCH}-binary >| test/test0018/proof || exit 4
out=$(sha256_check test/test0018/proof.answer)
[ "$out" = "test/test0018/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0019/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0019/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/match.c \
-f functions/in_set.c \
@ -38,30 +40,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/getopt.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/getopt.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/getopt.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0019-aarch64-binary \
-o test/results/test0019-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0019-aarch64-binary -f test/test0019/input -o test/test0019/proof || exit 4
./test/results/test0019-${ARCH}-binary -f test/test0019/input -o test/test0019/proof || exit 4
out=$(sha256_check test/test0019/proof.answer)
[ "$out" = "test/test0019/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0019/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0019/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/match.c \
-f functions/in_set.c \
@ -38,30 +40,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/getopt.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/getopt.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/getopt.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0019-amd64-binary \
-o test/results/test0019-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0019-amd64-binary -f test/test0019/input -o test/test0019/proof || exit 4
./test/results/test0019-${ARCH}-binary -f test/test0019/input -o test/test0019/proof || exit 4
out=$(sha256_check test/test0019/proof.answer)
[ "$out" = "test/test0019/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0019/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0019/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/match.c \
-f functions/in_set.c \
@ -38,30 +40,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/getopt.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/getopt.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/getopt.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0019-armv7l-binary \
-o test/results/test0019-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0019-armv7l-binary -f test/test0019/input -o test/test0019/proof || exit 4
./test/results/test0019-${ARCH}-binary -f test/test0019/input -o test/test0019/proof || exit 4
out=$(sha256_check test/test0019/proof.answer)
[ "$out" = "test/test0019/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -ex
TMPDIR="test/test0019/tmp-x86"
ARCH="x86"
TMPDIR="test/test0019/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/match.c \
-f functions/in_set.c \
@ -38,30 +40,30 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/getopt.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/getopt.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/getopt.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0019-x86-binary \
-o test/results/test0019-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0019-x86-binary -f test/test0019/input -o test/test0019/proof || exit 4
./test/results/test0019-${ARCH}-binary -f test/test0019/input -o test/test0019/proof || exit 4
out=$(sha256_check test/test0019/proof.answer)
[ "$out" = "test/test0019/proof: OK" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0020/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0020/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0020/struct.c \
-o ${TMPDIR}/struct.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0020-aarch64-binary \
-o test/results/test0020-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0020-aarch64-binary 2>&1 )
out=$(./test/results/test0020-${ARCH}-binary 2>&1 )
[ 40 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0020/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0020/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0020/struct.c \
-o ${TMPDIR}/struct.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0020-amd64-binary \
-o test/results/test0020-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0020-amd64-binary 2>&1 )
out=$(./test/results/test0020-${ARCH}-binary 2>&1 )
[ 40 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0020/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0020/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0020/struct.c \
-o ${TMPDIR}/struct.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0020-armv7l-binary \
-o test/results/test0020-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0020-armv7l-binary 2>&1 )
out=$(./test/results/test0020-${ARCH}-binary 2>&1 )
[ 20 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0020/tmp-x86"
ARCH="x86"
TMPDIR="test/test0020/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0020/struct.c \
-o ${TMPDIR}/struct.M1 \
@ -34,29 +36,29 @@ bin/M2-Planet \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0020-x86-binary \
-o test/results/test0020-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0020-x86-binary 2>&1 )
out=$(./test/results/test0020-${ARCH}-binary 2>&1 )
[ 20 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0021/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0021/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/match.c \
-f functions/file_print.c \
@ -45,31 +47,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/chdir.M1 \
-f ${TMPDIR}/chdir-footer.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/chdir.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/chdir.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0021-aarch64-binary \
-o test/results/test0021-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0021-aarch64-binary
./test/results/test0021-${ARCH}-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0021/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0021/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/match.c \
-f functions/file_print.c \
@ -45,31 +47,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/chdir.M1 \
-f ${TMPDIR}/chdir-footer.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/chdir.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/chdir.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0021-amd64-binary \
-o test/results/test0021-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0021-amd64-binary
./test/results/test0021-${ARCH}-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0021/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0021/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/match.c \
-f functions/file_print.c \
@ -44,31 +46,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/chdir.M1 \
-f ${TMPDIR}/chdir-footer.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/chdir.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/chdir.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0021-armv7l-binary \
-o test/results/test0021-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0021-armv7l-binary
./test/results/test0021-${ARCH}-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0021/tmp-x86"
ARCH="x86"
TMPDIR="test/test0021/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/match.c \
-f functions/file_print.c \
@ -44,31 +46,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/chdir.M1 \
-f ${TMPDIR}/chdir-footer.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/chdir.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/chdir.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0021-x86-binary \
-o test/results/test0021-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0021-x86-binary
./test/results/test0021-${ARCH}-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0022/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0022/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/in_set.c \
-f functions/numerate_number.c \
@ -46,31 +48,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/continue.M1 \
-f ${TMPDIR}/continue-footer.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/continue.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/continue.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0022-aarch64-binary \
-o test/results/test0022-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0022-aarch64-binary >| test/test0022/proof
./test/results/test0022-${ARCH}-binary >| test/test0022/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0022/proof.answer)
[ "$out" = "test/test0022/proof: OK" ] || exit 6

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0022/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0022/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/in_set.c \
-f functions/numerate_number.c \
@ -46,31 +48,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/continue.M1 \
-f ${TMPDIR}/continue-footer.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/continue.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/continue.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0022-amd64-binary \
-o test/results/test0022-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0022-amd64-binary >| test/test0022/proof
./test/results/test0022-${ARCH}-binary >| test/test0022/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0022/proof.answer)
[ "$out" = "test/test0022/proof: OK" ] || exit 6

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0022/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0022/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/in_set.c \
-f functions/numerate_number.c \
@ -45,31 +47,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/continue.M1 \
-f ${TMPDIR}/continue-footer.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/continue.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/continue.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0022-armv7l-binary \
-o test/results/test0022-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0022-armv7l-binary >| test/test0022/proof
./test/results/test0022-${ARCH}-binary >| test/test0022/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0022/proof.answer)
[ "$out" = "test/test0022/proof: OK" ] || exit 6

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0022/tmp-x86"
ARCH="x86"
TMPDIR="test/test0022/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f functions/in_set.c \
-f functions/numerate_number.c \
@ -45,31 +47,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/continue.M1 \
-f ${TMPDIR}/continue-footer.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/continue.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/continue.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0022-x86-binary \
-o test/results/test0022-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0022-x86-binary >| test/test0022/proof
./test/results/test0022-${ARCH}-binary >| test/test0022/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0022/proof.answer)
[ "$out" = "test/test0022/proof: OK" ] || exit 6

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0023/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0023/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/aarch64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0023/fseek.c \
--debug \
@ -43,31 +45,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/fseek.M1 \
-f ${TMPDIR}/fseek-footer.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/fseek.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/fseek.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0023-aarch64-binary \
-o test/results/test0023-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-aarch64-binary test/test0023/question >| test/test0023/proof
./test/results/test0023-${ARCH}-binary test/test0023/question >| test/test0023/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0023/proof.answer)
[ "$out" = "test/test0023/proof: OK" ] || exit 6

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0023/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0023/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0023/fseek.c \
--debug \
@ -43,31 +45,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/fseek.M1 \
-f ${TMPDIR}/fseek-footer.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/fseek.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/fseek.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0023-amd64-binary \
-o test/results/test0023-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-amd64-binary test/test0023/question >| test/test0023/proof
./test/results/test0023-${ARCH}-binary test/test0023/question >| test/test0023/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0023/proof.answer)
[ "$out" = "test/test0023/proof: OK" ] || exit 6

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0023/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0023/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0023/fseek.c \
--debug \
@ -42,31 +44,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/fseek.M1 \
-f ${TMPDIR}/fseek-footer.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/fseek.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/fseek.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0023-armv7l-binary \
-o test/results/test0023-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-armv7l-binary test/test0023/question >| test/test0023/proof
./test/results/test0023-${ARCH}-binary test/test0023/question >| test/test0023/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0023/proof.answer)
[ "$out" = "test/test0023/proof: OK" ] || exit 6

View File

@ -18,15 +18,17 @@
set -x
TMPDIR="test/test0023/tmp-x86"
ARCH="x86"
TMPDIR="test/test0023/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
--architecture ${ARCH} \
-f M2libc/${ARCH}/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/Linux/fcntl.h \
-f M2libc/${ARCH}/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0023/fseek.c \
--debug \
@ -42,31 +44,31 @@ blood-elf \
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-full.M1 \
-f ${TMPDIR}/fseek.M1 \
-f ${TMPDIR}/fseek-footer.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/fseek.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86-debug.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \
-f ${TMPDIR}/fseek.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0023-x86-binary \
-o test/results/test0023-${ARCH}-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-x86-binary test/test0023/question >| test/test0023/proof
./test/results/test0023-${ARCH}-binary test/test0023/question >| test/test0023/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0023/proof.answer)
[ "$out" = "test/test0023/proof: OK" ] || exit 6

View File

@ -18,41 +18,43 @@
set -x
TMPDIR="test/test0024/tmp-aarch64"
ARCH="aarch64"
TMPDIR="test/test0024/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
--architecture ${ARCH} \
-f test/test0024/return.c \
-o ${TMPDIR}/return.M1 \
|| exit 1
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/aarch64/aarch64_defs.M1 \
-f M2libc/aarch64/libc-core.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-core.M1 \
-f ${TMPDIR}/return.M1 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture aarch64 \
--architecture ${ARCH} \
--base-address 0x400000 \
-o test/results/test0024-aarch64-binary \
-o test/results/test0024-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0024-aarch64-binary
./test/results/test0024-${ARCH}-binary
[ 42 = $? ] || exit 4
fi
exit 0

View File

@ -18,41 +18,43 @@
set -x
TMPDIR="test/test0024/tmp-amd64"
ARCH="amd64"
TMPDIR="test/test0024/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
--architecture ${ARCH} \
-f test/test0024/return.c \
-o ${TMPDIR}/return.M1 \
|| exit 1
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-core.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-core.M1 \
-f ${TMPDIR}/return.M1 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture amd64 \
--architecture ${ARCH} \
--base-address 0x00600000 \
-o test/results/test0024-amd64-binary \
-o test/results/test0024-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0024-amd64-binary
./test/results/test0024-${ARCH}-binary
[ 42 = $? ] || exit 3
fi
exit 0

View File

@ -18,41 +18,43 @@
set -x
TMPDIR="test/test0024/tmp-armv7l"
ARCH="armv7l"
TMPDIR="test/test0024/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
--architecture ${ARCH} \
-f test/test0024/return.c \
-o ${TMPDIR}/return.M1 \
|| exit 1
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-core.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-core.M1 \
-f ${TMPDIR}/return.M1 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture armv7l \
--architecture ${ARCH} \
--base-address 0x10000 \
-o test/results/test0024-armv7l-binary \
-o test/results/test0024-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0024-armv7l-binary
./test/results/test0024-${ARCH}-binary
[ 42 = $? ] || exit 3
fi
exit 0

View File

@ -18,41 +18,43 @@
set -x
TMPDIR="test/test0024/tmp-x86"
ARCH="x86"
TMPDIR="test/test0024/tmp-${ARCH}"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
--architecture ${ARCH} \
-f test/test0024/return.c \
-o ${TMPDIR}/return.M1 \
|| exit 1
# Macro assemble with libc written in M1-Macro
M1 \
-f M2libc/x86/x86_defs.M1 \
-f M2libc/x86/libc-core.M1 \
-f M2libc/${ARCH}/${ARCH}_defs.M1 \
-f M2libc/${ARCH}/libc-core.M1 \
-f ${TMPDIR}/return.M1 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f M2libc/${ARCH}/ELF-${ARCH}.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture x86 \
--architecture ${ARCH} \
--base-address 0x8048000 \
-o test/results/test0024-x86-binary \
-o test/results/test0024-${ARCH}-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0024-x86-binary
./test/results/test0024-${ARCH}-binary
[ 42 = $? ] || exit 3
fi
exit 0

Some files were not shown because too many files have changed in this diff Show More