From 1a9bbe6e630907b35de329317e270b19dd3deccb Mon Sep 17 00:00:00 2001 From: deesix Date: Sun, 31 Jan 2021 00:00:00 +0100 Subject: [PATCH 01/10] @@@ tests: same --debug behaviour for all scripts of the same test Until now, a few scripts compiled the test program with/without debug, differently to the rest. --- test/test.answers | 8 ++++---- test/test0005/hello-armv7l.sh | 9 +-------- test/test0007/hello-aarch64.sh | 13 +------------ test/test0008/hello-armv7l.sh | 11 ++++++++++- test/test0106/hello-aarch64.sh | 11 +---------- 5 files changed, 17 insertions(+), 35 deletions(-) diff --git a/test/test.answers b/test/test.answers index c663244..88da26d 100644 --- a/test/test.answers +++ b/test/test.answers @@ -30,7 +30,7 @@ cff2e265d151bd2fa1713753543f78e2c9677470ffe220753660079a74025406 test/results/t 0cc6f7b9d753a2734e789b35d8cba7e10f65f17fc126a2efef403a49bd1b739c test/results/test0004-x86-binary 4b40361fe6e936ffc2f8f0afe46ec5c0c66b4bb3b30f56c84e18036f8b063e5a test/results/test0005-aarch64-binary ffc4a4da0880744053cba103abbde9fdd50bd5e298d0c8c51407d087b1b067dd test/results/test0005-amd64-binary -4d4d927953757473df56c7033996891acb5bae32510d92b5159e7aaf56c03d72 test/results/test0005-armv7l-binary +420ed88f5c9e026dc669d8e9d59e2bf12194af2ca5727e327297cd85607a6a81 test/results/test0005-armv7l-binary 66f964f025449632862eb190e668210a63535ae9d8c0dabde38c84f08f97b80b test/results/test0005-knight-native-binary 0278a97a86caf2c6a0b88214471d4f7f30c6b9b9361070e0b778211f4855e6bf test/results/test0005-knight-posix-binary 74f63fbaafd2cd097fdbc10dd9e2919f35a7477042dd6f02a85a8f0cf330d199 test/results/test0005-x86-binary @@ -40,7 +40,7 @@ f8134ad470e5e044aef91ee72882111a750162b1b4ebdb8a4027e548126a1ea3 test/results/t 285e9916e79075d4a4b5cfc947cc5d27df44edc9ebe091fae1095efd3a39110f test/results/test0006-knight-native-binary 4d90b082711dd7108e261d9acb353793e53e97b3c0bb00275d43a2bcb6ea34d0 test/results/test0006-knight-posix-binary 2fdab9370f3dca78c682f3334f393fb4a2d68c51f901006abe826b2b559cedab test/results/test0006-x86-binary -d65943dfce2047da4f2e6827ef484ab92f5369ee0d7d2e2d4a7e1c37b4dbaead test/results/test0007-aarch64-binary +d287f8ff8a7aa53e19ff9a8c772c374b1178016e0459097a91d36f69b7776345 test/results/test0007-aarch64-binary cfa4382e0e3edd23ed8a292fa8e8630ac3ca90eb424e4fd241f3509705dd7943 test/results/test0007-amd64-binary 876a38b259618a2c30e681c3f8ed624d9fd2a2873cb1e70dc826c444a004d535 test/results/test0007-armv7l-binary dc543f40901704ce9f352308c7759c8b581395f8683cfa248a03410dc3dc24bd test/results/test0007-knight-native-binary @@ -48,7 +48,7 @@ fffb165db40690ad5528028cb46f124bf1dab16e616b78fa037becc4428ac200 test/results/t de50c7139b401b684d34d9365f62301dd168a3a0c97e7cf325d84b7c0ca0af74 test/results/test0007-x86-binary 92e05eff2ad5a0eb414c916573bf75fadbfcd758fe0ab7f85d65de7ab3973518 test/results/test0008-aarch64-binary ab6c8c172b61d24374f1a387d1d02aadf3fab69c32f9d47c311928750725a2d4 test/results/test0008-amd64-binary -56765c0450f35869f2a7cfeab39b4e52b1a3a94f69c3ee52ad4bd42a1df3dfe8 test/results/test0008-armv7l-binary +17b4a191b57c66d40b3844c832d3892c3711dffc4605ca48130b723e8bbe795e test/results/test0008-armv7l-binary b54dd7a53e4e7619e7fe1761b827cfdf0c24b2317084ec7c06a7403c5d51c651 test/results/test0008-knight-native-binary 1d5a1d4f3197d1a0d6cc23fd681313fedfa450d402a1e1a25e47bacf5ee8241c test/results/test0008-knight-posix-binary f741233af242dba7df5e1c199c0c2f51ead1df049d3bd872c52d81feaaccb6af test/results/test0008-x86-binary @@ -173,7 +173,7 @@ d76e571526ae35c59bb2d022ed52ae5ff7d79a6790939c3251458d4cad0a4f75 test/results/t 54621f85782514a4fb8c16d8cf2796f6b88484ab0d06c379bf1d916d67fbd5bb test/results/test0105-amd64-binary d14529ef7c2c2af6a911027a33f05c14b1f772e8df29f28ed103c69c653ee442 test/results/test0105-armv7l-binary 46a5e68ffa6c12cbbfa6229926a0af08d3331bef41d233f3ac4a0335fe385c27 test/results/test0105-x86-binary -ca9fdf7c6720b7aff8a37a60608b89bb4a6941aa323c7038e0bcbb01af9a568d test/results/test0106-aarch64-binary +882fd086cb6688e26c60ae80351bb7a207843ae4169cd68a9eb2cb1db24b47ff test/results/test0106-aarch64-binary 447d78cd2526ef97cdf02f72bc2f492765f7c076c598cf3dbd3e8dd4507740b7 test/results/test0106-amd64-binary ba2e2e1bbe66fea15d5984678175229fcb0adc6faa394be2cfde8bea1d3026de test/results/test0106-armv7l-binary 698853b79efb30865a663c4863c050639eb21c7400008f7840830503928973d4 test/results/test0106-knight-native-binary diff --git a/test/test0005/hello-armv7l.sh b/test/test0005/hello-armv7l.sh index 1550f6f..3f9c3d6 100755 --- a/test/test0005/hello-armv7l.sh +++ b/test/test0005/hello-armv7l.sh @@ -29,21 +29,14 @@ bin/M2-Planet \ -f M2libc/armv7l/Linux/fcntl.h \ -f M2libc/stdio.c \ -f test/test0005/string.c \ - --debug \ -o ${TMPDIR}/string.M1 \ || exit 1 -blood-elf \ - -f ${TMPDIR}/string.M1 \ - -o ${TMPDIR}/string-footer.M1 \ - || exit 2 - # Macro assemble with libc written in M1-Macro M1 \ -f M2libc/armv7l/armv7l_defs.M1 \ -f M2libc/armv7l/libc-full.M1 \ -f ${TMPDIR}/string.M1 \ - -f ${TMPDIR}/string-footer.M1 \ --little-endian \ --architecture armv7l \ -o ${TMPDIR}/string.hex2 \ @@ -51,7 +44,7 @@ M1 \ # Resolve all linkages hex2 \ - -f M2libc/armv7l/ELF-armv7l-debug.hex2 \ + -f M2libc/armv7l/ELF-armv7l.hex2 \ -f ${TMPDIR}/string.hex2 \ --little-endian \ --architecture armv7l \ diff --git a/test/test0007/hello-aarch64.sh b/test/test0007/hello-aarch64.sh index c2d15b1..c3f7a62 100755 --- a/test/test0007/hello-aarch64.sh +++ b/test/test0007/hello-aarch64.sh @@ -29,25 +29,14 @@ bin/M2-Planet \ -f M2libc/aarch64/Linux/fcntl.h \ -f M2libc/stdio.c \ -f test/test0007/do.c \ - --debug \ -o ${TMPDIR}/do.M1 \ || exit 1 -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/do.M1 \ - --entry _start \ - -o ${TMPDIR}/do-footer.M1 \ - || exit 2 - - # Macro assemble with libc written in M1-Macro M1 \ -f M2libc/aarch64/aarch64_defs.M1 \ -f M2libc/aarch64/libc-full.M1 \ -f ${TMPDIR}/do.M1 \ - -f ${TMPDIR}/do-footer.M1 \ --little-endian \ --architecture aarch64 \ -o ${TMPDIR}/do.hex2 \ @@ -55,7 +44,7 @@ M1 \ # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64-debug.hex2 \ + -f M2libc/aarch64/ELF-aarch64.hex2 \ -f ${TMPDIR}/do.hex2 \ --little-endian \ --architecture aarch64 \ diff --git a/test/test0008/hello-armv7l.sh b/test/test0008/hello-armv7l.sh index cab02fb..f58d4d3 100755 --- a/test/test0008/hello-armv7l.sh +++ b/test/test0008/hello-armv7l.sh @@ -29,14 +29,23 @@ bin/M2-Planet \ -f M2libc/armv7l/Linux/fcntl.h \ -f M2libc/stdio.c \ -f test/test0008/struct.c \ + --debug \ -o ${TMPDIR}/struct.M1 \ || exit 1 +# Build debug footer +blood-elf \ + -f ${TMPDIR}/struct.M1 \ + --entry _start \ + -o ${TMPDIR}/struct-footer.M1 \ + || exit 2 + # Macro assemble with libc written in M1-Macro M1 \ -f M2libc/armv7l/armv7l_defs.M1 \ -f M2libc/armv7l/libc-full.M1 \ -f ${TMPDIR}/struct.M1 \ + -f ${TMPDIR}/struct-footer.M1 \ --little-endian \ --architecture armv7l \ -o ${TMPDIR}/struct.hex2 \ @@ -44,7 +53,7 @@ M1 \ # Resolve all linkages hex2 \ - -f M2libc/armv7l/ELF-armv7l.hex2 \ + -f M2libc/armv7l/ELF-armv7l-debug.hex2 \ -f ${TMPDIR}/struct.hex2 \ --little-endian \ --architecture armv7l \ diff --git a/test/test0106/hello-aarch64.sh b/test/test0106/hello-aarch64.sh index bf50e60..80f80c1 100755 --- a/test/test0106/hello-aarch64.sh +++ b/test/test0106/hello-aarch64.sh @@ -29,23 +29,14 @@ bin/M2-Planet \ -f M2libc/aarch64/Linux/fcntl.h \ -f M2libc/stdio.c \ -f test/test0106/cc500.c \ - --debug \ -o ${TMPDIR}/cc0.M1 \ || exit 1 -blood-elf \ - --64 \ - -f ${TMPDIR}/cc0.M1 \ - --entry _start \ - -o ${TMPDIR}/cc0-footer.M1 \ - || exit 2 - # Macro assemble with libc written in M1-Macro M1 \ -f M2libc/aarch64/aarch64_defs.M1 \ -f M2libc/aarch64/libc-full.M1 \ -f ${TMPDIR}/cc0.M1 \ - -f ${TMPDIR}/cc0-footer.M1 \ --little-endian \ --architecture aarch64 \ -o ${TMPDIR}/cc0.hex2 \ @@ -53,7 +44,7 @@ M1 \ # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64-debug.hex2 \ + -f M2libc/aarch64/ELF-aarch64.hex2 \ -f ${TMPDIR}/cc0.hex2 \ --little-endian \ --architecture aarch64 \ From f865e4764672fc187169f7d167c04cc621b22f6e Mon Sep 17 00:00:00 2001 From: deesix Date: Sun, 31 Jan 2021 00:00:00 +0100 Subject: [PATCH 02/10] @@@ tests: aarch64 test0100 using debug ELF header It was using the non-debug one but the rest of the compilation chain is done with debug in mind. --- test/test.answers | 2 +- test/test0100/hello-aarch64.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.answers b/test/test.answers index 88da26d..432390e 100644 --- a/test/test.answers +++ b/test/test.answers @@ -145,7 +145,7 @@ deb80d26727f797c397b927938360f846eb982dc0722903cb07947737332c443 test/results/t 930f40edcfbddb108926c1de3f24a86fd6e9dc40129a037866f5cf5206e278e9 test/results/test0025-amd64-binary 8f0de7d0a0b66d0050199621e8215b9c9a55ef62784acccef80a72238f361cd3 test/results/test0025-armv7l-binary 2adf4dd02db431f498cfa2803c66d632024fedcc6af70ff76c96726fad8442d4 test/results/test0025-x86-binary -d27e36cc2f30f69bd8bb86cef41241fbe35bcace6a179f952dbb51853b995a35 test/results/test0100-aarch64-binary +6fb7da24e7cce69125cce86666e6fdf852836cc03b8f5690ee2976ec2d647a24 test/results/test0100-aarch64-binary 18afb2596647b6755d686f787aa6dd69998b2dc8ae87879edf90e32469ded986 test/results/test0100-amd64-binary 174c5d09252e8056e1fbc11bb5bd637a5eeee26b7cf2867fa031c165209f4245 test/results/test0100-armv7l-binary ebecf1e841c9c6ef03eb656d8aa17722624728285df26db136c89a583f67f7b8 test/results/test0100-knight-posix-binary diff --git a/test/test0100/hello-aarch64.sh b/test/test0100/hello-aarch64.sh index 66ced76..4e9a3ac 100755 --- a/test/test0100/hello-aarch64.sh +++ b/test/test0100/hello-aarch64.sh @@ -56,7 +56,7 @@ M1 \ # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64.hex2 \ + -f M2libc/aarch64/ELF-aarch64-debug.hex2 \ -f ${TMPDIR}/blood-elf.hex2 \ --little-endian \ --architecture aarch64 \ From 6bb784eae5859965b55d303c686aeee09971e2ac Mon Sep 17 00:00:00 2001 From: deesix Date: Sun, 31 Jan 2021 00:00:00 +0100 Subject: [PATCH 03/10] tests: minor tweaks in comments --- test/test0007/hello-aarch64.sh | 2 +- test/test0025/hello-amd64.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test0007/hello-aarch64.sh b/test/test0007/hello-aarch64.sh index c3f7a62..8cb53f3 100755 --- a/test/test0007/hello-aarch64.sh +++ b/test/test0007/hello-aarch64.sh @@ -10,7 +10,7 @@ ## ## M2-Planet is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License diff --git a/test/test0025/hello-amd64.sh b/test/test0025/hello-amd64.sh index 1103fe1..bbfebb8 100755 --- a/test/test0025/hello-amd64.sh +++ b/test/test0025/hello-amd64.sh @@ -21,6 +21,7 @@ set -ex TMPDIR="test/test0025/tmp-amd64" mkdir -p ${TMPDIR} +# Build the test bin/M2-Planet \ --architecture amd64 \ -f M2libc/amd64/Linux/unistd.h \ From ab055a88237f39d207769b6813e916703fa6ae8e Mon Sep 17 00:00:00 2001 From: deesix Date: Sun, 31 Jan 2021 00:00:00 +0100 Subject: [PATCH 04/10] @@@ tests: ARCH var in non-Knight scripts --- test/test0000/hello-aarch64.sh | 22 ++++++++++++---------- test/test0000/hello-amd64.sh | 22 ++++++++++++---------- test/test0000/hello-armv7l.sh | 22 ++++++++++++---------- test/test0000/hello-x86.sh | 22 ++++++++++++---------- test/test0001/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0001/hello-amd64.sh | 26 ++++++++++++++------------ test/test0001/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0001/hello-x86.sh | 26 ++++++++++++++------------ test/test0002/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0002/hello-amd64.sh | 26 ++++++++++++++------------ test/test0002/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0002/hello-x86.sh | 26 ++++++++++++++------------ test/test0003/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0003/hello-amd64.sh | 26 ++++++++++++++------------ test/test0003/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0003/hello-x86.sh | 26 ++++++++++++++------------ test/test0004/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0004/hello-amd64.sh | 26 ++++++++++++++------------ test/test0004/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0004/hello-x86.sh | 26 ++++++++++++++------------ test/test0005/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0005/hello-amd64.sh | 26 ++++++++++++++------------ test/test0005/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0005/hello-x86.sh | 26 ++++++++++++++------------ test/test0006/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0006/hello-amd64.sh | 26 ++++++++++++++------------ test/test0006/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0006/hello-x86.sh | 26 ++++++++++++++------------ test/test0007/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0007/hello-amd64.sh | 26 ++++++++++++++------------ test/test0007/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0007/hello-x86.sh | 26 ++++++++++++++------------ test/test0008/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0008/hello-amd64.sh | 26 ++++++++++++++------------ test/test0008/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0008/hello-x86.sh | 26 ++++++++++++++------------ test/test0009/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0009/hello-amd64.sh | 26 ++++++++++++++------------ test/test0009/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0009/hello-x86.sh | 26 ++++++++++++++------------ test/test0010/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0010/hello-amd64.sh | 26 ++++++++++++++------------ test/test0010/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0010/hello-x86.sh | 26 ++++++++++++++------------ test/test0011/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0011/hello-amd64.sh | 26 ++++++++++++++------------ test/test0011/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0011/hello-x86.sh | 26 ++++++++++++++------------ test/test0012/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0012/hello-amd64.sh | 26 ++++++++++++++------------ test/test0012/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0012/hello-x86.sh | 26 ++++++++++++++------------ test/test0013/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0013/hello-amd64.sh | 26 ++++++++++++++------------ test/test0013/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0013/hello-x86.sh | 26 ++++++++++++++------------ test/test0014/hello-aarch64.sh | 28 +++++++++++++++------------- test/test0014/hello-amd64.sh | 28 +++++++++++++++------------- test/test0014/hello-armv7l.sh | 28 +++++++++++++++------------- test/test0014/hello-x86.sh | 28 +++++++++++++++------------- test/test0015/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0015/hello-amd64.sh | 26 ++++++++++++++------------ test/test0015/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0015/hello-x86.sh | 26 ++++++++++++++------------ test/test0016/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0016/hello-amd64.sh | 26 ++++++++++++++------------ test/test0016/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0016/hello-x86.sh | 26 ++++++++++++++------------ test/test0017/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0017/hello-amd64.sh | 26 ++++++++++++++------------ test/test0017/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0017/hello-x86.sh | 26 ++++++++++++++------------ test/test0018/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0018/hello-amd64.sh | 26 ++++++++++++++------------ test/test0018/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0018/hello-x86.sh | 26 ++++++++++++++------------ test/test0019/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0019/hello-amd64.sh | 26 ++++++++++++++------------ test/test0019/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0019/hello-x86.sh | 26 ++++++++++++++------------ test/test0020/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0020/hello-amd64.sh | 26 ++++++++++++++------------ test/test0020/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0020/hello-x86.sh | 26 ++++++++++++++------------ test/test0021/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0021/hello-amd64.sh | 26 ++++++++++++++------------ test/test0021/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0021/hello-x86.sh | 26 ++++++++++++++------------ test/test0022/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0022/hello-amd64.sh | 26 ++++++++++++++------------ test/test0022/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0022/hello-x86.sh | 26 ++++++++++++++------------ test/test0023/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0023/hello-amd64.sh | 26 ++++++++++++++------------ test/test0023/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0023/hello-x86.sh | 26 ++++++++++++++------------ test/test0024/hello-aarch64.sh | 22 ++++++++++++---------- test/test0024/hello-amd64.sh | 22 ++++++++++++---------- test/test0024/hello-armv7l.sh | 22 ++++++++++++---------- test/test0024/hello-x86.sh | 22 ++++++++++++---------- test/test0025/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0025/hello-amd64.sh | 26 ++++++++++++++------------ test/test0025/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0025/hello-x86.sh | 26 ++++++++++++++------------ test/test0100/hello-aarch64.sh | 28 +++++++++++++++------------- test/test0100/hello-amd64.sh | 28 +++++++++++++++------------- test/test0100/hello-armv7l.sh | 28 +++++++++++++++------------- test/test0100/hello-x86.sh | 28 +++++++++++++++------------- test/test0101/hello-aarch64.sh | 28 +++++++++++++++------------- test/test0101/hello-amd64.sh | 28 +++++++++++++++------------- test/test0101/hello-armv7l.sh | 28 +++++++++++++++------------- test/test0101/hello-x86.sh | 32 +++++++++++++++++--------------- test/test0102/hello-aarch64.sh | 28 +++++++++++++++------------- test/test0102/hello-amd64.sh | 28 +++++++++++++++------------- test/test0102/hello-armv7l.sh | 28 +++++++++++++++------------- test/test0102/hello-x86.sh | 34 ++++++++++++++++++---------------- test/test0103/hello-aarch64.sh | 28 +++++++++++++++------------- test/test0103/hello-amd64.sh | 28 +++++++++++++++------------- test/test0103/hello-armv7l.sh | 28 +++++++++++++++------------- test/test0103/hello-x86.sh | 28 +++++++++++++++------------- test/test0104/hello-aarch64.sh | 28 +++++++++++++++------------- test/test0104/hello-amd64.sh | 28 +++++++++++++++------------- test/test0104/hello-armv7l.sh | 28 +++++++++++++++------------- test/test0104/hello-x86.sh | 28 +++++++++++++++------------- test/test0105/hello-aarch64.sh | 28 +++++++++++++++------------- test/test0105/hello-amd64.sh | 28 +++++++++++++++------------- test/test0105/hello-armv7l.sh | 28 +++++++++++++++------------- test/test0105/hello-x86.sh | 28 +++++++++++++++------------- test/test0106/hello-aarch64.sh | 26 ++++++++++++++------------ test/test0106/hello-amd64.sh | 26 ++++++++++++++------------ test/test0106/hello-armv7l.sh | 26 ++++++++++++++------------ test/test0106/hello-x86.sh | 26 ++++++++++++++------------ 132 files changed, 1865 insertions(+), 1601 deletions(-) diff --git a/test/test0000/hello-aarch64.sh b/test/test0000/hello-aarch64.sh index c025bad..05ced42 100755 --- a/test/test0000/hello-aarch64.sh +++ b/test/test0000/hello-aarch64.sh @@ -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 diff --git a/test/test0000/hello-amd64.sh b/test/test0000/hello-amd64.sh index 3c61e2d..fba5a7c 100755 --- a/test/test0000/hello-amd64.sh +++ b/test/test0000/hello-amd64.sh @@ -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 diff --git a/test/test0000/hello-armv7l.sh b/test/test0000/hello-armv7l.sh index 9b70455..98e6966 100755 --- a/test/test0000/hello-armv7l.sh +++ b/test/test0000/hello-armv7l.sh @@ -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 diff --git a/test/test0000/hello-x86.sh b/test/test0000/hello-x86.sh index 76aad92..42e95c6 100755 --- a/test/test0000/hello-x86.sh +++ b/test/test0000/hello-x86.sh @@ -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 diff --git a/test/test0001/hello-aarch64.sh b/test/test0001/hello-aarch64.sh index bec79b3..35183fc 100755 --- a/test/test0001/hello-aarch64.sh +++ b/test/test0001/hello-aarch64.sh @@ -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 diff --git a/test/test0001/hello-amd64.sh b/test/test0001/hello-amd64.sh index 181865b..4a7bd5c 100755 --- a/test/test0001/hello-amd64.sh +++ b/test/test0001/hello-amd64.sh @@ -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 diff --git a/test/test0001/hello-armv7l.sh b/test/test0001/hello-armv7l.sh index dab9265..416d6fd 100755 --- a/test/test0001/hello-armv7l.sh +++ b/test/test0001/hello-armv7l.sh @@ -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 diff --git a/test/test0001/hello-x86.sh b/test/test0001/hello-x86.sh index ecab79b..550ce9b 100755 --- a/test/test0001/hello-x86.sh +++ b/test/test0001/hello-x86.sh @@ -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 diff --git a/test/test0002/hello-aarch64.sh b/test/test0002/hello-aarch64.sh index c24d7e8..24bfd48 100755 --- a/test/test0002/hello-aarch64.sh +++ b/test/test0002/hello-aarch64.sh @@ -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 diff --git a/test/test0002/hello-amd64.sh b/test/test0002/hello-amd64.sh index 27fb110..dd27f19 100755 --- a/test/test0002/hello-amd64.sh +++ b/test/test0002/hello-amd64.sh @@ -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 diff --git a/test/test0002/hello-armv7l.sh b/test/test0002/hello-armv7l.sh index ef82e79..aa15d80 100755 --- a/test/test0002/hello-armv7l.sh +++ b/test/test0002/hello-armv7l.sh @@ -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 diff --git a/test/test0002/hello-x86.sh b/test/test0002/hello-x86.sh index dae54c6..458f4c0 100755 --- a/test/test0002/hello-x86.sh +++ b/test/test0002/hello-x86.sh @@ -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 diff --git a/test/test0003/hello-aarch64.sh b/test/test0003/hello-aarch64.sh index 0cba87b..6b42581 100755 --- a/test/test0003/hello-aarch64.sh +++ b/test/test0003/hello-aarch64.sh @@ -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 diff --git a/test/test0003/hello-amd64.sh b/test/test0003/hello-amd64.sh index c8f1522..cd3aa20 100755 --- a/test/test0003/hello-amd64.sh +++ b/test/test0003/hello-amd64.sh @@ -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 diff --git a/test/test0003/hello-armv7l.sh b/test/test0003/hello-armv7l.sh index 8e58f17..ea65678 100755 --- a/test/test0003/hello-armv7l.sh +++ b/test/test0003/hello-armv7l.sh @@ -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 diff --git a/test/test0003/hello-x86.sh b/test/test0003/hello-x86.sh index 0a12d8d..42ebd53 100755 --- a/test/test0003/hello-x86.sh +++ b/test/test0003/hello-x86.sh @@ -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 diff --git a/test/test0004/hello-aarch64.sh b/test/test0004/hello-aarch64.sh index 7671cf7..3b95f90 100755 --- a/test/test0004/hello-aarch64.sh +++ b/test/test0004/hello-aarch64.sh @@ -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 diff --git a/test/test0004/hello-amd64.sh b/test/test0004/hello-amd64.sh index 669bf72..a04776b 100755 --- a/test/test0004/hello-amd64.sh +++ b/test/test0004/hello-amd64.sh @@ -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 diff --git a/test/test0004/hello-armv7l.sh b/test/test0004/hello-armv7l.sh index 9bfbdf3..4ba25d9 100755 --- a/test/test0004/hello-armv7l.sh +++ b/test/test0004/hello-armv7l.sh @@ -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 diff --git a/test/test0004/hello-x86.sh b/test/test0004/hello-x86.sh index ac25569..f4fd9be 100755 --- a/test/test0004/hello-x86.sh +++ b/test/test0004/hello-x86.sh @@ -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 diff --git a/test/test0005/hello-aarch64.sh b/test/test0005/hello-aarch64.sh index 209677c..1edeeed 100755 --- a/test/test0005/hello-aarch64.sh +++ b/test/test0005/hello-aarch64.sh @@ -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 diff --git a/test/test0005/hello-amd64.sh b/test/test0005/hello-amd64.sh index c11bf4e..6a45c8c 100755 --- a/test/test0005/hello-amd64.sh +++ b/test/test0005/hello-amd64.sh @@ -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 diff --git a/test/test0005/hello-armv7l.sh b/test/test0005/hello-armv7l.sh index 3f9c3d6..26d6d67 100755 --- a/test/test0005/hello-armv7l.sh +++ b/test/test0005/hello-armv7l.sh @@ -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 diff --git a/test/test0005/hello-x86.sh b/test/test0005/hello-x86.sh index cd003d0..e78fdb9 100755 --- a/test/test0005/hello-x86.sh +++ b/test/test0005/hello-x86.sh @@ -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 diff --git a/test/test0006/hello-aarch64.sh b/test/test0006/hello-aarch64.sh index 12358de..7fcebc8 100755 --- a/test/test0006/hello-aarch64.sh +++ b/test/test0006/hello-aarch64.sh @@ -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 diff --git a/test/test0006/hello-amd64.sh b/test/test0006/hello-amd64.sh index d60213c..147896a 100755 --- a/test/test0006/hello-amd64.sh +++ b/test/test0006/hello-amd64.sh @@ -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 diff --git a/test/test0006/hello-armv7l.sh b/test/test0006/hello-armv7l.sh index ac62f49..6612685 100755 --- a/test/test0006/hello-armv7l.sh +++ b/test/test0006/hello-armv7l.sh @@ -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 diff --git a/test/test0006/hello-x86.sh b/test/test0006/hello-x86.sh index 2f6aa0d..4a69549 100755 --- a/test/test0006/hello-x86.sh +++ b/test/test0006/hello-x86.sh @@ -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 diff --git a/test/test0007/hello-aarch64.sh b/test/test0007/hello-aarch64.sh index 8cb53f3..1db9cea 100755 --- a/test/test0007/hello-aarch64.sh +++ b/test/test0007/hello-aarch64.sh @@ -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 diff --git a/test/test0007/hello-amd64.sh b/test/test0007/hello-amd64.sh index cb57a9d..2d07bc8 100755 --- a/test/test0007/hello-amd64.sh +++ b/test/test0007/hello-amd64.sh @@ -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 diff --git a/test/test0007/hello-armv7l.sh b/test/test0007/hello-armv7l.sh index dd0e4af..c0af2b0 100755 --- a/test/test0007/hello-armv7l.sh +++ b/test/test0007/hello-armv7l.sh @@ -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 diff --git a/test/test0007/hello-x86.sh b/test/test0007/hello-x86.sh index 6524196..f281bef 100755 --- a/test/test0007/hello-x86.sh +++ b/test/test0007/hello-x86.sh @@ -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 diff --git a/test/test0008/hello-aarch64.sh b/test/test0008/hello-aarch64.sh index 31a4c63..4075d28 100755 --- a/test/test0008/hello-aarch64.sh +++ b/test/test0008/hello-aarch64.sh @@ -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 diff --git a/test/test0008/hello-amd64.sh b/test/test0008/hello-amd64.sh index 5784ddc..b5dd80f 100755 --- a/test/test0008/hello-amd64.sh +++ b/test/test0008/hello-amd64.sh @@ -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 diff --git a/test/test0008/hello-armv7l.sh b/test/test0008/hello-armv7l.sh index f58d4d3..b89a273 100755 --- a/test/test0008/hello-armv7l.sh +++ b/test/test0008/hello-armv7l.sh @@ -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 diff --git a/test/test0008/hello-x86.sh b/test/test0008/hello-x86.sh index bd3a287..d3adf6a 100755 --- a/test/test0008/hello-x86.sh +++ b/test/test0008/hello-x86.sh @@ -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 diff --git a/test/test0009/hello-aarch64.sh b/test/test0009/hello-aarch64.sh index cbd540f..5c69d89 100755 --- a/test/test0009/hello-aarch64.sh +++ b/test/test0009/hello-aarch64.sh @@ -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 diff --git a/test/test0009/hello-amd64.sh b/test/test0009/hello-amd64.sh index 9703464..b857920 100755 --- a/test/test0009/hello-amd64.sh +++ b/test/test0009/hello-amd64.sh @@ -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 diff --git a/test/test0009/hello-armv7l.sh b/test/test0009/hello-armv7l.sh index 9cdfe6a..2689587 100755 --- a/test/test0009/hello-armv7l.sh +++ b/test/test0009/hello-armv7l.sh @@ -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 diff --git a/test/test0009/hello-x86.sh b/test/test0009/hello-x86.sh index 85557f8..5e4b5a8 100755 --- a/test/test0009/hello-x86.sh +++ b/test/test0009/hello-x86.sh @@ -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 diff --git a/test/test0010/hello-aarch64.sh b/test/test0010/hello-aarch64.sh index 7c446e2..f01f9f9 100755 --- a/test/test0010/hello-aarch64.sh +++ b/test/test0010/hello-aarch64.sh @@ -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 diff --git a/test/test0010/hello-amd64.sh b/test/test0010/hello-amd64.sh index 6515937..cba2a57 100755 --- a/test/test0010/hello-amd64.sh +++ b/test/test0010/hello-amd64.sh @@ -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 diff --git a/test/test0010/hello-armv7l.sh b/test/test0010/hello-armv7l.sh index 2a7129f..596f6f9 100755 --- a/test/test0010/hello-armv7l.sh +++ b/test/test0010/hello-armv7l.sh @@ -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 diff --git a/test/test0010/hello-x86.sh b/test/test0010/hello-x86.sh index 3ab5079..2bdfc75 100755 --- a/test/test0010/hello-x86.sh +++ b/test/test0010/hello-x86.sh @@ -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 diff --git a/test/test0011/hello-aarch64.sh b/test/test0011/hello-aarch64.sh index 3804d8c..8f76d04 100755 --- a/test/test0011/hello-aarch64.sh +++ b/test/test0011/hello-aarch64.sh @@ -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 diff --git a/test/test0011/hello-amd64.sh b/test/test0011/hello-amd64.sh index f7b109b..4952b3a 100755 --- a/test/test0011/hello-amd64.sh +++ b/test/test0011/hello-amd64.sh @@ -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 diff --git a/test/test0011/hello-armv7l.sh b/test/test0011/hello-armv7l.sh index 326086a..1d411ff 100755 --- a/test/test0011/hello-armv7l.sh +++ b/test/test0011/hello-armv7l.sh @@ -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 diff --git a/test/test0011/hello-x86.sh b/test/test0011/hello-x86.sh index 21ce86f..ec959e8 100755 --- a/test/test0011/hello-x86.sh +++ b/test/test0011/hello-x86.sh @@ -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 diff --git a/test/test0012/hello-aarch64.sh b/test/test0012/hello-aarch64.sh index 5ba6ea7..e1c6408 100755 --- a/test/test0012/hello-aarch64.sh +++ b/test/test0012/hello-aarch64.sh @@ -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 diff --git a/test/test0012/hello-amd64.sh b/test/test0012/hello-amd64.sh index 5eb9829..c0709e8 100755 --- a/test/test0012/hello-amd64.sh +++ b/test/test0012/hello-amd64.sh @@ -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 diff --git a/test/test0012/hello-armv7l.sh b/test/test0012/hello-armv7l.sh index 981ca3a..19ce0fc 100755 --- a/test/test0012/hello-armv7l.sh +++ b/test/test0012/hello-armv7l.sh @@ -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 diff --git a/test/test0012/hello-x86.sh b/test/test0012/hello-x86.sh index 3a40a5c..144b722 100755 --- a/test/test0012/hello-x86.sh +++ b/test/test0012/hello-x86.sh @@ -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 diff --git a/test/test0013/hello-aarch64.sh b/test/test0013/hello-aarch64.sh index 9350a26..f73e5b7 100755 --- a/test/test0013/hello-aarch64.sh +++ b/test/test0013/hello-aarch64.sh @@ -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 diff --git a/test/test0013/hello-amd64.sh b/test/test0013/hello-amd64.sh index b881216..cc8d459 100755 --- a/test/test0013/hello-amd64.sh +++ b/test/test0013/hello-amd64.sh @@ -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 diff --git a/test/test0013/hello-armv7l.sh b/test/test0013/hello-armv7l.sh index ad75533..009fcd1 100755 --- a/test/test0013/hello-armv7l.sh +++ b/test/test0013/hello-armv7l.sh @@ -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 diff --git a/test/test0013/hello-x86.sh b/test/test0013/hello-x86.sh index ff30b09..2fe415b 100755 --- a/test/test0013/hello-x86.sh +++ b/test/test0013/hello-x86.sh @@ -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 diff --git a/test/test0014/hello-aarch64.sh b/test/test0014/hello-aarch64.sh index dc5242d..43284c2 100755 --- a/test/test0014/hello-aarch64.sh +++ b/test/test0014/hello-aarch64.sh @@ -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 diff --git a/test/test0014/hello-amd64.sh b/test/test0014/hello-amd64.sh index 7819d3a..71a8177 100755 --- a/test/test0014/hello-amd64.sh +++ b/test/test0014/hello-amd64.sh @@ -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 diff --git a/test/test0014/hello-armv7l.sh b/test/test0014/hello-armv7l.sh index 59bddfd..a467a4e 100755 --- a/test/test0014/hello-armv7l.sh +++ b/test/test0014/hello-armv7l.sh @@ -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 diff --git a/test/test0014/hello-x86.sh b/test/test0014/hello-x86.sh index bc8b6d2..82c5f52 100755 --- a/test/test0014/hello-x86.sh +++ b/test/test0014/hello-x86.sh @@ -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 diff --git a/test/test0015/hello-aarch64.sh b/test/test0015/hello-aarch64.sh index 48acb0a..56c18f5 100755 --- a/test/test0015/hello-aarch64.sh +++ b/test/test0015/hello-aarch64.sh @@ -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 diff --git a/test/test0015/hello-amd64.sh b/test/test0015/hello-amd64.sh index 2c39d24..3e33b18 100755 --- a/test/test0015/hello-amd64.sh +++ b/test/test0015/hello-amd64.sh @@ -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 diff --git a/test/test0015/hello-armv7l.sh b/test/test0015/hello-armv7l.sh index 810477a..56a372a 100755 --- a/test/test0015/hello-armv7l.sh +++ b/test/test0015/hello-armv7l.sh @@ -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 diff --git a/test/test0015/hello-x86.sh b/test/test0015/hello-x86.sh index 963c067..e580034 100755 --- a/test/test0015/hello-x86.sh +++ b/test/test0015/hello-x86.sh @@ -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 diff --git a/test/test0016/hello-aarch64.sh b/test/test0016/hello-aarch64.sh index e421bfc..d500662 100755 --- a/test/test0016/hello-aarch64.sh +++ b/test/test0016/hello-aarch64.sh @@ -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 diff --git a/test/test0016/hello-amd64.sh b/test/test0016/hello-amd64.sh index 9f8d33e..0f0e772 100755 --- a/test/test0016/hello-amd64.sh +++ b/test/test0016/hello-amd64.sh @@ -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 diff --git a/test/test0016/hello-armv7l.sh b/test/test0016/hello-armv7l.sh index 716d9ed..10e6a05 100755 --- a/test/test0016/hello-armv7l.sh +++ b/test/test0016/hello-armv7l.sh @@ -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 diff --git a/test/test0016/hello-x86.sh b/test/test0016/hello-x86.sh index ff7b168..b113870 100755 --- a/test/test0016/hello-x86.sh +++ b/test/test0016/hello-x86.sh @@ -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 diff --git a/test/test0017/hello-aarch64.sh b/test/test0017/hello-aarch64.sh index 401ad13..e041582 100755 --- a/test/test0017/hello-aarch64.sh +++ b/test/test0017/hello-aarch64.sh @@ -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 diff --git a/test/test0017/hello-amd64.sh b/test/test0017/hello-amd64.sh index 005d00a..4d0d284 100755 --- a/test/test0017/hello-amd64.sh +++ b/test/test0017/hello-amd64.sh @@ -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 diff --git a/test/test0017/hello-armv7l.sh b/test/test0017/hello-armv7l.sh index 9ce100e..d43daff 100755 --- a/test/test0017/hello-armv7l.sh +++ b/test/test0017/hello-armv7l.sh @@ -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 diff --git a/test/test0017/hello-x86.sh b/test/test0017/hello-x86.sh index 67de167..2176f9b 100755 --- a/test/test0017/hello-x86.sh +++ b/test/test0017/hello-x86.sh @@ -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 diff --git a/test/test0018/hello-aarch64.sh b/test/test0018/hello-aarch64.sh index bc34406..d949c26 100755 --- a/test/test0018/hello-aarch64.sh +++ b/test/test0018/hello-aarch64.sh @@ -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 diff --git a/test/test0018/hello-amd64.sh b/test/test0018/hello-amd64.sh index f723498..f4d77c0 100755 --- a/test/test0018/hello-amd64.sh +++ b/test/test0018/hello-amd64.sh @@ -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 diff --git a/test/test0018/hello-armv7l.sh b/test/test0018/hello-armv7l.sh index f877e75..a731ae2 100755 --- a/test/test0018/hello-armv7l.sh +++ b/test/test0018/hello-armv7l.sh @@ -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 diff --git a/test/test0018/hello-x86.sh b/test/test0018/hello-x86.sh index 3d0e39c..5878d74 100755 --- a/test/test0018/hello-x86.sh +++ b/test/test0018/hello-x86.sh @@ -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 diff --git a/test/test0019/hello-aarch64.sh b/test/test0019/hello-aarch64.sh index 90d6e35..b7449dc 100755 --- a/test/test0019/hello-aarch64.sh +++ b/test/test0019/hello-aarch64.sh @@ -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 diff --git a/test/test0019/hello-amd64.sh b/test/test0019/hello-amd64.sh index e58cbcc..6f7933a 100755 --- a/test/test0019/hello-amd64.sh +++ b/test/test0019/hello-amd64.sh @@ -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 diff --git a/test/test0019/hello-armv7l.sh b/test/test0019/hello-armv7l.sh index 8257724..7c7fbc5 100755 --- a/test/test0019/hello-armv7l.sh +++ b/test/test0019/hello-armv7l.sh @@ -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 diff --git a/test/test0019/hello-x86.sh b/test/test0019/hello-x86.sh index d1952e3..1bf49fa 100755 --- a/test/test0019/hello-x86.sh +++ b/test/test0019/hello-x86.sh @@ -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 diff --git a/test/test0020/hello-aarch64.sh b/test/test0020/hello-aarch64.sh index 1b99e56..21f88e4 100755 --- a/test/test0020/hello-aarch64.sh +++ b/test/test0020/hello-aarch64.sh @@ -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 diff --git a/test/test0020/hello-amd64.sh b/test/test0020/hello-amd64.sh index 7a03519..4092ec3 100755 --- a/test/test0020/hello-amd64.sh +++ b/test/test0020/hello-amd64.sh @@ -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 diff --git a/test/test0020/hello-armv7l.sh b/test/test0020/hello-armv7l.sh index fe62cf6..835da67 100755 --- a/test/test0020/hello-armv7l.sh +++ b/test/test0020/hello-armv7l.sh @@ -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 diff --git a/test/test0020/hello-x86.sh b/test/test0020/hello-x86.sh index a9b7817..9655845 100755 --- a/test/test0020/hello-x86.sh +++ b/test/test0020/hello-x86.sh @@ -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 diff --git a/test/test0021/hello-aarch64.sh b/test/test0021/hello-aarch64.sh index 41f6179..6d3e899 100755 --- a/test/test0021/hello-aarch64.sh +++ b/test/test0021/hello-aarch64.sh @@ -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 diff --git a/test/test0021/hello-amd64.sh b/test/test0021/hello-amd64.sh index 24a0d06..23f3ea5 100755 --- a/test/test0021/hello-amd64.sh +++ b/test/test0021/hello-amd64.sh @@ -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 diff --git a/test/test0021/hello-armv7l.sh b/test/test0021/hello-armv7l.sh index 0ee4673..3d22e33 100755 --- a/test/test0021/hello-armv7l.sh +++ b/test/test0021/hello-armv7l.sh @@ -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 diff --git a/test/test0021/hello-x86.sh b/test/test0021/hello-x86.sh index 7a01163..a0ec696 100755 --- a/test/test0021/hello-x86.sh +++ b/test/test0021/hello-x86.sh @@ -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 diff --git a/test/test0022/hello-aarch64.sh b/test/test0022/hello-aarch64.sh index 63c7933..350343f 100755 --- a/test/test0022/hello-aarch64.sh +++ b/test/test0022/hello-aarch64.sh @@ -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 diff --git a/test/test0022/hello-amd64.sh b/test/test0022/hello-amd64.sh index a7a1fc9..4c9f7e7 100755 --- a/test/test0022/hello-amd64.sh +++ b/test/test0022/hello-amd64.sh @@ -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 diff --git a/test/test0022/hello-armv7l.sh b/test/test0022/hello-armv7l.sh index 0aeb015..076b3d3 100755 --- a/test/test0022/hello-armv7l.sh +++ b/test/test0022/hello-armv7l.sh @@ -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 diff --git a/test/test0022/hello-x86.sh b/test/test0022/hello-x86.sh index 1d6dcd4..a1fb246 100755 --- a/test/test0022/hello-x86.sh +++ b/test/test0022/hello-x86.sh @@ -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 diff --git a/test/test0023/hello-aarch64.sh b/test/test0023/hello-aarch64.sh index ecc2d97..0ca88b5 100755 --- a/test/test0023/hello-aarch64.sh +++ b/test/test0023/hello-aarch64.sh @@ -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 diff --git a/test/test0023/hello-amd64.sh b/test/test0023/hello-amd64.sh index 53c90b1..19ac832 100755 --- a/test/test0023/hello-amd64.sh +++ b/test/test0023/hello-amd64.sh @@ -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 diff --git a/test/test0023/hello-armv7l.sh b/test/test0023/hello-armv7l.sh index 0d9c837..834d14d 100755 --- a/test/test0023/hello-armv7l.sh +++ b/test/test0023/hello-armv7l.sh @@ -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 diff --git a/test/test0023/hello-x86.sh b/test/test0023/hello-x86.sh index b7270ad..1b46406 100755 --- a/test/test0023/hello-x86.sh +++ b/test/test0023/hello-x86.sh @@ -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 diff --git a/test/test0024/hello-aarch64.sh b/test/test0024/hello-aarch64.sh index 7cbd9a5..9643b5e 100755 --- a/test/test0024/hello-aarch64.sh +++ b/test/test0024/hello-aarch64.sh @@ -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 diff --git a/test/test0024/hello-amd64.sh b/test/test0024/hello-amd64.sh index a72c437..04d99f5 100755 --- a/test/test0024/hello-amd64.sh +++ b/test/test0024/hello-amd64.sh @@ -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 diff --git a/test/test0024/hello-armv7l.sh b/test/test0024/hello-armv7l.sh index 8d81b35..1ce2034 100755 --- a/test/test0024/hello-armv7l.sh +++ b/test/test0024/hello-armv7l.sh @@ -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 diff --git a/test/test0024/hello-x86.sh b/test/test0024/hello-x86.sh index 3d1effd..f6803af 100755 --- a/test/test0024/hello-x86.sh +++ b/test/test0024/hello-x86.sh @@ -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 diff --git a/test/test0025/hello-aarch64.sh b/test/test0025/hello-aarch64.sh index 9e90f15..5f84e11 100755 --- a/test/test0025/hello-aarch64.sh +++ b/test/test0025/hello-aarch64.sh @@ -18,15 +18,17 @@ set -ex -TMPDIR="test/test0025/tmp-aarch64" +ARCH="aarch64" +TMPDIR="test/test0025/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/test0025/array.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}/array.M1 \ -f ${TMPDIR}/array-footer.M1 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/array.hex2 \ || exit 2 # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/array.hex2 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ --base-address 0x400000 \ - -o test/results/test0025-aarch64-binary \ + -o test/results/test0025-${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/test0025-aarch64-binary 2>| test/test0025/proof || exit 4 + ./test/results/test0025-${ARCH}-binary 2>| test/test0025/proof || exit 4 out=$(sha256_check test/test0025/proof.answer) [ "$out" = "test/test0025/proof: OK" ] || exit 5 fi diff --git a/test/test0025/hello-amd64.sh b/test/test0025/hello-amd64.sh index bbfebb8..b317dc3 100755 --- a/test/test0025/hello-amd64.sh +++ b/test/test0025/hello-amd64.sh @@ -18,15 +18,17 @@ set -ex -TMPDIR="test/test0025/tmp-amd64" +ARCH="amd64" +TMPDIR="test/test0025/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/test0025/array.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}/array.M1 \ -f ${TMPDIR}/array-footer.M1 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/array.hex2 \ || exit 2 # Resolve all linkages hex2 \ - -f M2libc/amd64/ELF-amd64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/array.hex2 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ --base-address 0x00600000 \ - -o test/results/test0025-amd64-binary \ + -o test/results/test0025-${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/test0025-amd64-binary 2>| test/test0025/proof || exit 4 + ./test/results/test0025-${ARCH}-binary 2>| test/test0025/proof || exit 4 out=$(sha256_check test/test0025/proof.answer) [ "$out" = "test/test0025/proof: OK" ] || exit 5 fi diff --git a/test/test0025/hello-armv7l.sh b/test/test0025/hello-armv7l.sh index ccba7e3..cd9e7b7 100755 --- a/test/test0025/hello-armv7l.sh +++ b/test/test0025/hello-armv7l.sh @@ -18,15 +18,17 @@ set -ex -TMPDIR="test/test0025/tmp-armv7l" +ARCH="armv7l" +TMPDIR="test/test0025/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/test0025/array.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}/array.M1 \ -f ${TMPDIR}/array-footer.M1 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ -o ${TMPDIR}/array.hex2 \ || exit 2 # Resolve all linkages hex2 \ - -f M2libc/armv7l/ELF-armv7l-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/array.hex2 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ --base-address 0x10000 \ - -o test/results/test0025-armv7l-binary \ + -o test/results/test0025-${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/test0025-armv7l-binary 2>| test/test0025/proof || exit 4 + ./test/results/test0025-${ARCH}-binary 2>| test/test0025/proof || exit 4 out=$(sha256_check test/test0025/proof.answer) [ "$out" = "test/test0025/proof: OK" ] || exit 5 fi diff --git a/test/test0025/hello-x86.sh b/test/test0025/hello-x86.sh index 69ad3c7..0e80ca1 100755 --- a/test/test0025/hello-x86.sh +++ b/test/test0025/hello-x86.sh @@ -18,15 +18,17 @@ set -ex -TMPDIR="test/test0025/tmp-x86" +ARCH="x86" +TMPDIR="test/test0025/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/test0025/array.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}/array.M1 \ -f ${TMPDIR}/array-footer.M1 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ -o ${TMPDIR}/array.hex2 \ || exit 2 # Resolve all linkages hex2 \ - -f M2libc/x86/ELF-x86-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/array.hex2 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ --base-address 0x8048000 \ - -o test/results/test0025-x86-binary \ + -o test/results/test0025-${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/test0025-x86-binary 2>| test/test0025/proof || exit 4 + ./test/results/test0025-${ARCH}-binary 2>| test/test0025/proof || exit 4 out=$(sha256_check test/test0025/proof.answer) [ "$out" = "test/test0025/proof: OK" ] || exit 5 fi diff --git a/test/test0100/hello-aarch64.sh b/test/test0100/hello-aarch64.sh index 4e9a3ac..8ceb35b 100755 --- a/test/test0100/hello-aarch64.sh +++ b/test/test0100/hello-aarch64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0100/tmp-aarch64" +ARCH="aarch64" +TMPDIR="test/test0100/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/file_print.c \ -f functions/match.c \ @@ -45,37 +47,37 @@ 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}/blood-elf.M1 \ -f ${TMPDIR}/blood-elf-footer.M1 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/blood-elf.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/blood-elf.hex2 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ --base-address 0x400000 \ - -o test/results/test0100-aarch64-binary \ + -o test/results/test0100-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0100-aarch64-binary --version 2>&1 ) + out=$(./test/results/test0100-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "blood-elf 0.1 (Basically Launches Odd Object Dump ExecutabLe Files" ] || exit 6 . ./sha256.sh # Verify that the resulting file works - ./test/results/test0100-aarch64-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 + ./test/results/test0100-${ARCH}-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 out=$(sha256_check test/test0100/proof.answer) [ "$out" = "test/test0100/proof: OK" ] || exit 8 fi diff --git a/test/test0100/hello-amd64.sh b/test/test0100/hello-amd64.sh index b780d55..bbadfb8 100755 --- a/test/test0100/hello-amd64.sh +++ b/test/test0100/hello-amd64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0100/tmp-amd64" +ARCH="amd64" +TMPDIR="test/test0100/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/file_print.c \ -f functions/match.c \ @@ -45,37 +47,37 @@ 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}/blood-elf.M1 \ -f ${TMPDIR}/blood-elf-footer.M1 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/blood-elf.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/amd64/ELF-amd64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/blood-elf.hex2 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ --base-address 0x00600000 \ - -o test/results/test0100-amd64-binary \ + -o test/results/test0100-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0100-amd64-binary --version 2>&1 ) + out=$(./test/results/test0100-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "blood-elf 0.1 (Basically Launches Odd Object Dump ExecutabLe Files" ] || exit 6 . ./sha256.sh # Verify that the resulting file works - ./test/results/test0100-amd64-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 + ./test/results/test0100-${ARCH}-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 out=$(sha256_check test/test0100/proof.answer) [ "$out" = "test/test0100/proof: OK" ] || exit 8 fi diff --git a/test/test0100/hello-armv7l.sh b/test/test0100/hello-armv7l.sh index aebc75b..721184b 100755 --- a/test/test0100/hello-armv7l.sh +++ b/test/test0100/hello-armv7l.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0100/tmp-armv7l" +ARCH="armv7l" +TMPDIR="test/test0100/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/file_print.c \ -f functions/match.c \ @@ -44,37 +46,37 @@ 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}/blood-elf.M1 \ -f ${TMPDIR}/blood-elf-footer.M1 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ -o ${TMPDIR}/blood-elf.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/armv7l/ELF-armv7l-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/blood-elf.hex2 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ --base-address 0x10000 \ - -o test/results/test0100-armv7l-binary \ + -o test/results/test0100-${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/test0100-armv7l-binary --version 2>&1 ) + out=$(./test/results/test0100-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "blood-elf 0.1 (Basically Launches Odd Object Dump ExecutabLe Files" ] || exit 6 . ./sha256.sh # Verify that the resulting file works - ./test/results/test0100-armv7l-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 + ./test/results/test0100-${ARCH}-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 out=$(sha256_check test/test0100/proof.answer) [ "$out" = "test/test0100/proof: OK" ] || exit 8 fi diff --git a/test/test0100/hello-x86.sh b/test/test0100/hello-x86.sh index 5477892..735880a 100755 --- a/test/test0100/hello-x86.sh +++ b/test/test0100/hello-x86.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0100/tmp-x86" +ARCH="x86" +TMPDIR="test/test0100/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/file_print.c \ -f functions/match.c \ @@ -44,37 +46,37 @@ 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}/blood-elf.M1 \ -f ${TMPDIR}/blood-elf-footer.M1 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ -o ${TMPDIR}/blood-elf.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/x86/ELF-x86-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/blood-elf.hex2 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ --base-address 0x8048000 \ - -o test/results/test0100-x86-binary \ + -o test/results/test0100-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0100-x86-binary --version 2>&1 ) + out=$(./test/results/test0100-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "blood-elf 0.1 (Basically Launches Odd Object Dump ExecutabLe Files" ] || exit 6 . ./sha256.sh # Verify that the resulting file works - ./test/results/test0100-x86-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 + ./test/results/test0100-${ARCH}-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 out=$(sha256_check test/test0100/proof.answer) [ "$out" = "test/test0100/proof: OK" ] || exit 8 fi diff --git a/test/test0101/hello-aarch64.sh b/test/test0101/hello-aarch64.sh index 89243ec..8767063 100755 --- a/test/test0101/hello-aarch64.sh +++ b/test/test0101/hello-aarch64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0101/tmp-aarch64" +ARCH="aarch64" +TMPDIR="test/test0101/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/file_print.c \ -f functions/match.c \ @@ -47,36 +49,36 @@ 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}/hex2_linker.M1 \ -f ${TMPDIR}/hex2_linker-footer.M1 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/hex2_linker.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/hex2_linker.hex2 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ --base-address 0x400000 \ - -o test/results/test0101-aarch64-binary \ + -o test/results/test0101-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0101-aarch64-binary --version 2>&1 ) + out=$(./test/results/test0101-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "hex2 0.3" ] || exit 6 . ./sha256.sh # Verify that the resulting file works - ./test/results/test0101-aarch64-binary \ + ./test/results/test0101-${ARCH}-binary \ -f M2libc/x86/ELF-x86.hex2 \ -f test/test0101/test.hex2 \ --LittleEndian \ diff --git a/test/test0101/hello-amd64.sh b/test/test0101/hello-amd64.sh index dd03bf3..f13c9c5 100755 --- a/test/test0101/hello-amd64.sh +++ b/test/test0101/hello-amd64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0101/tmp-amd64" +ARCH="amd64" +TMPDIR="test/test0101/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/file_print.c \ -f functions/match.c \ @@ -47,36 +49,36 @@ 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}/hex2_linker.M1 \ -f ${TMPDIR}/hex2_linker-footer.M1 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/hex2_linker.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/amd64/ELF-amd64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/hex2_linker.hex2 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ --base-address 0x00600000 \ - -o test/results/test0101-amd64-binary \ + -o test/results/test0101-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0101-amd64-binary --version 2>&1 ) + out=$(./test/results/test0101-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "hex2 0.3" ] || exit 6 . ./sha256.sh # Verify that the resulting file works - ./test/results/test0101-amd64-binary \ + ./test/results/test0101-${ARCH}-binary \ -f M2libc/x86/ELF-x86.hex2 \ -f test/test0101/test.hex2 \ --LittleEndian \ diff --git a/test/test0101/hello-armv7l.sh b/test/test0101/hello-armv7l.sh index 317d623..f237fb9 100755 --- a/test/test0101/hello-armv7l.sh +++ b/test/test0101/hello-armv7l.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0101/tmp-armv7l" +ARCH="armv7l" +TMPDIR="test/test0101/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/file_print.c \ -f functions/match.c \ @@ -46,36 +48,36 @@ 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}/hex2_linker.M1 \ -f ${TMPDIR}/hex2_linker-footer.M1 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ -o ${TMPDIR}/hex2_linker.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/armv7l/ELF-armv7l-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/hex2_linker.hex2 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ --base-address 0x10000 \ - -o test/results/test0101-armv7l-binary \ + -o test/results/test0101-${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/test0101-armv7l-binary --version 2>&1 ) + out=$(./test/results/test0101-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "hex2 0.3" ] || exit 6 . ./sha256.sh # Verify that the resulting file works - ./test/results/test0101-armv7l-binary \ + ./test/results/test0101-${ARCH}-binary \ -f M2libc/x86/ELF-x86.hex2 \ -f test/test0101/test.hex2 \ --LittleEndian \ diff --git a/test/test0101/hello-x86.sh b/test/test0101/hello-x86.sh index 3583e74..76796a8 100755 --- a/test/test0101/hello-x86.sh +++ b/test/test0101/hello-x86.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0101/tmp-x86" +ARCH="x86" +TMPDIR="test/test0101/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/file_print.c \ -f functions/match.c \ @@ -46,40 +48,40 @@ 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}/hex2_linker.M1 \ -f ${TMPDIR}/hex2_linker-footer.M1 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ -o ${TMPDIR}/hex2_linker.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/x86/ELF-x86-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/hex2_linker.hex2 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ --base-address 0x8048000 \ - -o test/results/test0101-x86-binary \ + -o test/results/test0101-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0101-x86-binary --version 2>&1 ) + out=$(./test/results/test0101-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "hex2 0.3" ] || exit 6 . ./sha256.sh # Verify that the resulting file works - ./test/results/test0101-x86-binary \ - -f M2libc/x86/ELF-x86.hex2 \ + ./test/results/test0101-${ARCH}-binary \ + -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f test/test0101/test.hex2 \ --LittleEndian \ - --architecture x86 \ + --architecture ${ARCH} \ --BaseAddress 0x8048000 \ -o test/test0101/proof \ || exit 7 diff --git a/test/test0102/hello-aarch64.sh b/test/test0102/hello-aarch64.sh index 6095dd3..af10933 100755 --- a/test/test0102/hello-aarch64.sh +++ b/test/test0102/hello-aarch64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0102/tmp-aarch64" +ARCH="aarch64" +TMPDIR="test/test0102/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/file_print.c \ -f functions/match.c \ @@ -49,35 +51,35 @@ 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}/M1-macro.M1 \ -f ${TMPDIR}/M1-macro-footer.M1 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/M1-macro.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/M1-macro.hex2 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ --base-address 0x400000 \ - -o test/results/test0102-aarch64-binary \ + -o test/results/test0102-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0102-aarch64-binary --version 2>&1 ) + out=$(./test/results/test0102-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "M1 1.0.0" ] || exit 6 # Verify that the resulting file works - ./test/results/test0102-aarch64-binary \ + ./test/results/test0102-${ARCH}-binary \ -f M2libc/x86/x86_defs.M1 \ -f M2libc/x86/libc-core.M1 \ -f test/test0100/test.M1 \ diff --git a/test/test0102/hello-amd64.sh b/test/test0102/hello-amd64.sh index e6312f3..b969022 100755 --- a/test/test0102/hello-amd64.sh +++ b/test/test0102/hello-amd64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0102/tmp-amd64" +ARCH="amd64" +TMPDIR="test/test0102/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/file_print.c \ -f functions/match.c \ @@ -49,35 +51,35 @@ 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}/M1-macro.M1 \ -f ${TMPDIR}/M1-macro-footer.M1 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/M1-macro.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/amd64/ELF-amd64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/M1-macro.hex2 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ --base-address 0x00600000 \ - -o test/results/test0102-amd64-binary \ + -o test/results/test0102-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0102-amd64-binary --version 2>&1 ) + out=$(./test/results/test0102-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "M1 1.0.0" ] || exit 6 # Verify that the resulting file works - ./test/results/test0102-amd64-binary \ + ./test/results/test0102-${ARCH}-binary \ -f M2libc/x86/x86_defs.M1 \ -f M2libc/x86/libc-core.M1 \ -f test/test0100/test.M1 \ diff --git a/test/test0102/hello-armv7l.sh b/test/test0102/hello-armv7l.sh index 7f8c725..03c1d5e 100755 --- a/test/test0102/hello-armv7l.sh +++ b/test/test0102/hello-armv7l.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0102/tmp-armv7l" +ARCH="armv7l" +TMPDIR="test/test0102/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/file_print.c \ -f functions/match.c \ @@ -48,35 +50,35 @@ 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}/M1-macro.M1 \ -f ${TMPDIR}/M1-macro-footer.M1 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ -o ${TMPDIR}/M1-macro.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/armv7l/ELF-armv7l-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/M1-macro.hex2 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ --base-address 0x10000 \ - -o test/results/test0102-armv7l-binary \ + -o test/results/test0102-${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/test0102-armv7l-binary --version 2>&1 ) + out=$(./test/results/test0102-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "M1 1.0.0" ] || exit 6 # Verify that the resulting file works - ./test/results/test0102-armv7l-binary \ + ./test/results/test0102-${ARCH}-binary \ -f M2libc/x86/x86_defs.M1 \ -f M2libc/x86/libc-core.M1 \ -f test/test0100/test.M1 \ diff --git a/test/test0102/hello-x86.sh b/test/test0102/hello-x86.sh index 3c67f4b..6b9e9b3 100755 --- a/test/test0102/hello-x86.sh +++ b/test/test0102/hello-x86.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0102/tmp-x86" +ARCH="x86" +TMPDIR="test/test0102/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/file_print.c \ -f functions/match.c \ @@ -48,40 +50,40 @@ 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}/M1-macro.M1 \ -f ${TMPDIR}/M1-macro-footer.M1 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ -o ${TMPDIR}/M1-macro.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/x86/ELF-x86-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/M1-macro.hex2 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ --base-address 0x8048000 \ - -o test/results/test0102-x86-binary \ + -o test/results/test0102-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0102-x86-binary --version 2>&1 ) + out=$(./test/results/test0102-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "M1 1.0.0" ] || exit 6 # Verify that the resulting file works - ./test/results/test0102-x86-binary \ - -f M2libc/x86/x86_defs.M1 \ - -f M2libc/x86/libc-core.M1 \ + ./test/results/test0102-${ARCH}-binary \ + -f M2libc/${ARCH}/${ARCH}_defs.M1 \ + -f M2libc/${ARCH}/libc-core.M1 \ -f test/test0100/test.M1 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ -o test/test0102/proof \ || exit 7 diff --git a/test/test0103/hello-aarch64.sh b/test/test0103/hello-aarch64.sh index 9182149..318fc5f 100755 --- a/test/test0103/hello-aarch64.sh +++ b/test/test0103/hello-aarch64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0103/tmp-aarch64" +ARCH="aarch64" +TMPDIR="test/test0103/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/file_print.c \ -f functions/match.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}/get_machine.M1 \ -f ${TMPDIR}/get_machine-footer.M1 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/get_machine.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/get_machine.hex2 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ --base-address 0x400000 \ - -o test/results/test0103-aarch64-binary \ + -o test/results/test0103-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0103-aarch64-binary ${GET_MACHINE_FLAGS} 2>&1 ) + out=$(./test/results/test0103-${ARCH}-binary ${GET_MACHINE_FLAGS} 2>&1 ) [ 0 = $? ] || exit 5 - [ "$out" = "aarch64" ] || exit 6 + [ "$out" = "${ARCH}" ] || exit 6 fi exit 0 diff --git a/test/test0103/hello-amd64.sh b/test/test0103/hello-amd64.sh index bd0b484..61b0f0c 100755 --- a/test/test0103/hello-amd64.sh +++ b/test/test0103/hello-amd64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0103/tmp-amd64" +ARCH="amd64" +TMPDIR="test/test0103/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/file_print.c \ -f functions/match.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}/get_machine.M1 \ -f ${TMPDIR}/get_machine-footer.M1 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/get_machine.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/amd64/ELF-amd64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/get_machine.hex2 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ --base-address 0x00600000 \ - -o test/results/test0103-amd64-binary \ + -o test/results/test0103-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0103-amd64-binary ${GET_MACHINE_FLAGS} 2>&1 ) + out=$(./test/results/test0103-${ARCH}-binary ${GET_MACHINE_FLAGS} 2>&1 ) [ 0 = $? ] || exit 5 - [ "$out" = "amd64" ] || exit 6 + [ "$out" = "${ARCH}" ] || exit 6 fi exit 0 diff --git a/test/test0103/hello-armv7l.sh b/test/test0103/hello-armv7l.sh index b0295e2..680fd2a 100755 --- a/test/test0103/hello-armv7l.sh +++ b/test/test0103/hello-armv7l.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0103/tmp-armv7l" +ARCH="armv7l" +TMPDIR="test/test0103/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/file_print.c \ -f functions/match.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}/get_machine.M1 \ -f ${TMPDIR}/get_machine-footer.M1 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ -o ${TMPDIR}/get_machine.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/armv7l/ELF-armv7l-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/get_machine.hex2 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ --base-address 0x10000 \ - -o test/results/test0103-armv7l-binary \ + -o test/results/test0103-${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/test0103-armv7l-binary ${GET_MACHINE_FLAGS} 2>&1 ) + out=$(./test/results/test0103-${ARCH}-binary ${GET_MACHINE_FLAGS} 2>&1 ) [ 0 = $? ] || exit 5 - [ "$out" = "armv7l" ] || exit 6 + [ "$out" = "${ARCH}" ] || exit 6 fi exit 0 diff --git a/test/test0103/hello-x86.sh b/test/test0103/hello-x86.sh index c9f6d05..f17a31a 100755 --- a/test/test0103/hello-x86.sh +++ b/test/test0103/hello-x86.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0103/tmp-x86" +ARCH="x86" +TMPDIR="test/test0103/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/file_print.c \ -f functions/match.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}/get_machine.M1 \ -f ${TMPDIR}/get_machine-footer.M1 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ -o ${TMPDIR}/get_machine.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/x86/ELF-x86-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/get_machine.hex2 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ --base-address 0x8048000 \ - -o test/results/test0103-x86-binary \ + -o test/results/test0103-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0103-x86-binary ${GET_MACHINE_FLAGS} 2>&1 ) + out=$(./test/results/test0103-${ARCH}-binary ${GET_MACHINE_FLAGS} 2>&1 ) [ 0 = $? ] || exit 5 - [ "$out" = "x86" ] || exit 6 + [ "$out" = "${ARCH}" ] || exit 6 fi exit 0 diff --git a/test/test0104/hello-aarch64.sh b/test/test0104/hello-aarch64.sh index d2db015..4dd82a8 100755 --- a/test/test0104/hello-aarch64.sh +++ b/test/test0104/hello-aarch64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0104/tmp-aarch64" +ARCH="aarch64" +TMPDIR="test/test0104/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/file_print.c \ -f functions/match.c \ @@ -47,34 +49,34 @@ 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}/kaem.M1 \ -f ${TMPDIR}/kaem-footer.M1 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/kaem.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/kaem.hex2 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ --base-address 0x400000 \ - -o test/results/test0104-aarch64-binary \ + -o test/results/test0104-${ARCH}-binary \ || exit 4 -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/test0104-aarch64-binary --version 2>&1 ) + out=$(./test/results/test0104-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "kaem version 0.6.0" ] || exit 6 # Verify that the resulting file works - out=$(./test/results/test0104-aarch64-binary --file test/test0104/kaem.run) + out=$(./test/results/test0104-${ARCH}-binary --file test/test0104/kaem.run) [ "$out" = "hello world" ] || exit 7 fi exit 0 diff --git a/test/test0104/hello-amd64.sh b/test/test0104/hello-amd64.sh index 057f208..14623b1 100755 --- a/test/test0104/hello-amd64.sh +++ b/test/test0104/hello-amd64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0104/tmp-amd64" +ARCH="amd64" +TMPDIR="test/test0104/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/file_print.c \ -f functions/match.c \ @@ -47,34 +49,34 @@ 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}/kaem.M1 \ -f ${TMPDIR}/kaem-footer.M1 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/kaem.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/amd64/ELF-amd64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/kaem.hex2 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ --base-address 0x00600000 \ - -o test/results/test0104-amd64-binary \ + -o test/results/test0104-${ARCH}-binary \ || exit 4 -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/test0104-amd64-binary --version 2>&1 ) + out=$(./test/results/test0104-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "kaem version 0.6.0" ] || exit 6 # Verify that the resulting file works - out=$(./test/results/test0104-amd64-binary --file test/test0104/kaem.run) + out=$(./test/results/test0104-${ARCH}-binary --file test/test0104/kaem.run) [ "$out" = "hello world" ] || exit 7 fi exit 0 diff --git a/test/test0104/hello-armv7l.sh b/test/test0104/hello-armv7l.sh index fa15a32..09c996c 100755 --- a/test/test0104/hello-armv7l.sh +++ b/test/test0104/hello-armv7l.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0104/tmp-armv7l" +ARCH="armv7l" +TMPDIR="test/test0104/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/file_print.c \ -f functions/match.c \ @@ -46,34 +48,34 @@ 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}/kaem.M1 \ -f ${TMPDIR}/kaem-footer.M1 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ -o ${TMPDIR}/kaem.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/armv7l/ELF-armv7l-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/kaem.hex2 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ --base-address 0x10000 \ - -o test/results/test0104-armv7l-binary \ + -o test/results/test0104-${ARCH}-binary \ || exit 4 -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/test0104-armv7l-binary --version 2>&1 ) + out=$(./test/results/test0104-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "kaem version 0.6.0" ] || exit 6 # Verify that the resulting file works - out=$(./test/results/test0104-armv7l-binary --file test/test0104/kaem.run) + out=$(./test/results/test0104-${ARCH}-binary --file test/test0104/kaem.run) [ "$out" = "hello world" ] || exit 7 fi exit 0 diff --git a/test/test0104/hello-x86.sh b/test/test0104/hello-x86.sh index df0ac74..e97d0d5 100755 --- a/test/test0104/hello-x86.sh +++ b/test/test0104/hello-x86.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0104/tmp-x86" +ARCH="x86" +TMPDIR="test/test0104/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/file_print.c \ -f functions/match.c \ @@ -46,34 +48,34 @@ 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}/kaem.M1 \ -f ${TMPDIR}/kaem-footer.M1 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ -o ${TMPDIR}/kaem.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/x86/ELF-x86-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/kaem.hex2 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ --base-address 0x8048000 \ - -o test/results/test0104-x86-binary \ + -o test/results/test0104-${ARCH}-binary \ || exit 4 -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/test0104-x86-binary --version 2>&1 ) + out=$(./test/results/test0104-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "kaem version 0.6.0" ] || exit 6 # Verify that the resulting file works - out=$(./test/results/test0104-x86-binary --file test/test0104/kaem.run) + out=$(./test/results/test0104-${ARCH}-binary --file test/test0104/kaem.run) [ "$out" = "hello world" ] || exit 7 fi exit 0 diff --git a/test/test0105/hello-aarch64.sh b/test/test0105/hello-aarch64.sh index 2de7f4f..e85aa16 100755 --- a/test/test0105/hello-aarch64.sh +++ b/test/test0105/hello-aarch64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0105/tmp-aarch64" +ARCH="aarch64" +TMPDIR="test/test0105/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/test0105/lisp.h \ -f functions/in_set.c \ @@ -52,35 +54,35 @@ 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}/lisp.M1 \ -f ${TMPDIR}/lisp-footer.M1 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/lisp.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/lisp.hex2 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ --base-address 0x400000 \ - -o test/results/test0105-aarch64-binary \ + -o test/results/test0105-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0105-aarch64-binary --version 2>&1 ) + out=$(./test/results/test0105-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "Slow_Lisp 0.1" ] || exit 6 # Verify that the resulting file works - out=$(./test/results/test0105-aarch64-binary --file test/test0105/test.scm) + out=$(./test/results/test0105-${ARCH}-binary --file test/test0105/test.scm) [ "$out" = "42" ] || exit 7 fi exit 0 diff --git a/test/test0105/hello-amd64.sh b/test/test0105/hello-amd64.sh index 25da7fc..583f79e 100755 --- a/test/test0105/hello-amd64.sh +++ b/test/test0105/hello-amd64.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0105/tmp-amd64" +ARCH="amd64" +TMPDIR="test/test0105/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/test0105/lisp.h \ -f functions/in_set.c \ @@ -52,35 +54,35 @@ 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}/lisp.M1 \ -f ${TMPDIR}/lisp-footer.M1 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/lisp.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/amd64/ELF-amd64-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/lisp.hex2 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ --base-address 0x00600000 \ - -o test/results/test0105-amd64-binary \ + -o test/results/test0105-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0105-amd64-binary --version 2>&1 ) + out=$(./test/results/test0105-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "Slow_Lisp 0.1" ] || exit 6 # Verify that the resulting file works - out=$(./test/results/test0105-amd64-binary --file test/test0105/test.scm) + out=$(./test/results/test0105-${ARCH}-binary --file test/test0105/test.scm) [ "$out" = "42" ] || exit 7 fi exit 0 diff --git a/test/test0105/hello-armv7l.sh b/test/test0105/hello-armv7l.sh index 04d9b95..5ad6e00 100755 --- a/test/test0105/hello-armv7l.sh +++ b/test/test0105/hello-armv7l.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0105/tmp-armv7l" +ARCH="armv7l" +TMPDIR="test/test0105/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/test0105/lisp.h \ -f functions/in_set.c \ @@ -51,35 +53,35 @@ 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}/lisp.M1 \ -f ${TMPDIR}/lisp-footer.M1 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ -o ${TMPDIR}/lisp.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/armv7l/ELF-armv7l-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/lisp.hex2 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ --base-address 0x10000 \ - -o test/results/test0105-armv7l-binary \ + -o test/results/test0105-${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/test0105-armv7l-binary --version 2>&1 ) + out=$(./test/results/test0105-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "Slow_Lisp 0.1" ] || exit 6 # Verify that the resulting file works - out=$(./test/results/test0105-armv7l-binary --file test/test0105/test.scm) + out=$(./test/results/test0105-${ARCH}-binary --file test/test0105/test.scm) [ "$out" = "42" ] || exit 7 fi exit 0 diff --git a/test/test0105/hello-x86.sh b/test/test0105/hello-x86.sh index ad3230b..7b193e2 100755 --- a/test/test0105/hello-x86.sh +++ b/test/test0105/hello-x86.sh @@ -18,15 +18,17 @@ set -x -TMPDIR="test/test0105/tmp-x86" +ARCH="x86" +TMPDIR="test/test0105/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/test0105/lisp.h \ -f functions/in_set.c \ @@ -51,35 +53,35 @@ 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}/lisp.M1 \ -f ${TMPDIR}/lisp-footer.M1 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ -o ${TMPDIR}/lisp.hex2 \ || exit 3 # Resolve all linkages hex2 \ - -f M2libc/x86/ELF-x86-debug.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/lisp.hex2 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ --base-address 0x8048000 \ - -o test/results/test0105-x86-binary \ + -o test/results/test0105-${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 # Verify that the compiled program returns the correct result - out=$(./test/results/test0105-x86-binary --version 2>&1 ) + out=$(./test/results/test0105-${ARCH}-binary --version 2>&1 ) [ 0 = $? ] || exit 5 [ "$out" = "Slow_Lisp 0.1" ] || exit 6 # Verify that the resulting file works - out=$(./test/results/test0105-x86-binary --file test/test0105/test.scm) + out=$(./test/results/test0105-${ARCH}-binary --file test/test0105/test.scm) [ "$out" = "42" ] || exit 7 fi exit 0 diff --git a/test/test0106/hello-aarch64.sh b/test/test0106/hello-aarch64.sh index 80f80c1..e15b493 100755 --- a/test/test0106/hello-aarch64.sh +++ b/test/test0106/hello-aarch64.sh @@ -18,15 +18,17 @@ set -ex -TMPDIR="test/test0106/tmp-aarch64" +ARCH="aarch64" +TMPDIR="test/test0106/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/test0106/cc500.c \ -o ${TMPDIR}/cc0.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}/cc0.M1 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/cc0.hex2 \ || exit 2 # Resolve all linkages hex2 \ - -f M2libc/aarch64/ELF-aarch64.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/cc0.hex2 \ --little-endian \ - --architecture aarch64 \ + --architecture ${ARCH} \ --base-address 0x400000 \ - -o test/results/test0106-aarch64-binary \ + -o test/results/test0106-${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 compiled program can compile itself - ./test/results/test0106-aarch64-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 + ./test/results/test0106-${ARCH}-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 out=$(sha256_check test/test0106/proof0.answer) [ "$out" = "test/test0106/cc1: OK" ] || exit 5 fi diff --git a/test/test0106/hello-amd64.sh b/test/test0106/hello-amd64.sh index b191bc4..fa071cb 100755 --- a/test/test0106/hello-amd64.sh +++ b/test/test0106/hello-amd64.sh @@ -18,15 +18,17 @@ set -ex -TMPDIR="test/test0106/tmp-amd64" +ARCH="amd64" +TMPDIR="test/test0106/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/test0106/cc500.c \ -o ${TMPDIR}/cc0.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}/cc0.M1 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ -o ${TMPDIR}/cc0.hex2 \ || exit 2 # Resolve all linkages hex2 \ - -f M2libc/amd64/ELF-amd64.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/cc0.hex2 \ --little-endian \ - --architecture amd64 \ + --architecture ${ARCH} \ --base-address 0x00600000 \ - -o test/results/test0106-amd64-binary \ + -o test/results/test0106-${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 compiled program can compile itself - ./test/results/test0106-amd64-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 + ./test/results/test0106-${ARCH}-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 out=$(sha256_check test/test0106/proof0.answer) [ "$out" = "test/test0106/cc1: OK" ] || exit 5 diff --git a/test/test0106/hello-armv7l.sh b/test/test0106/hello-armv7l.sh index 6261aff..d9557a0 100755 --- a/test/test0106/hello-armv7l.sh +++ b/test/test0106/hello-armv7l.sh @@ -18,15 +18,17 @@ set -ex -TMPDIR="test/test0106/tmp-armv7l" +ARCH="armv7l" +TMPDIR="test/test0106/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/test0106/cc500.c \ -o ${TMPDIR}/cc0.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}/cc0.M1 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ -o ${TMPDIR}/cc0.hex2 \ || exit 2 # Resolve all linkages hex2 \ - -f M2libc/armv7l/ELF-armv7l.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/cc0.hex2 \ --little-endian \ - --architecture armv7l \ + --architecture ${ARCH} \ --base-address 0x10000 \ - -o test/results/test0106-armv7l-binary \ + -o test/results/test0106-${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 compiled program can compile itself - ./test/results/test0106-armv7l-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 + ./test/results/test0106-${ARCH}-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 out=$(sha256_check test/test0106/proof0.answer) [ "$out" = "test/test0106/cc1: OK" ] || exit 5 fi diff --git a/test/test0106/hello-x86.sh b/test/test0106/hello-x86.sh index b26b292..de49ea6 100755 --- a/test/test0106/hello-x86.sh +++ b/test/test0106/hello-x86.sh @@ -18,15 +18,17 @@ set -ex -TMPDIR="test/test0106/tmp-x86" +ARCH="x86" +TMPDIR="test/test0106/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/test0106/cc500.c \ -o ${TMPDIR}/cc0.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}/cc0.M1 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ -o ${TMPDIR}/cc0.hex2 \ || exit 2 # Resolve all linkages hex2 \ - -f M2libc/x86/ELF-x86.hex2 \ + -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/cc0.hex2 \ --little-endian \ - --architecture x86 \ + --architecture ${ARCH} \ --base-address 0x8048000 \ - -o test/results/test0106-x86-binary \ + -o test/results/test0106-${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 compiled program can compile itself - ./test/results/test0106-x86-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 + ./test/results/test0106-${ARCH}-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 out=$(sha256_check test/test0106/proof0.answer) [ "$out" = "test/test0106/cc1: OK" ] || exit 5 From fb5bae96ab8b977f1375e9e33d8a357f1f302243 Mon Sep 17 00:00:00 2001 From: deesix Date: Sun, 31 Jan 2021 00:00:00 +0100 Subject: [PATCH 05/10] @@@ tests: source new test/env.inc.sh ... which sets, given the ARCH, the following vars: BASE_ADDRESS ENDIANNESS_FLAG --- test/env.inc.sh | 40 ++++++++++++++++++++++++++++++++++ test/test0000/hello-aarch64.sh | 7 +++--- test/test0000/hello-amd64.sh | 7 +++--- test/test0000/hello-armv7l.sh | 7 +++--- test/test0000/hello-x86.sh | 7 +++--- test/test0001/hello-aarch64.sh | 7 +++--- test/test0001/hello-amd64.sh | 7 +++--- test/test0001/hello-armv7l.sh | 7 +++--- test/test0001/hello-x86.sh | 7 +++--- test/test0002/hello-aarch64.sh | 7 +++--- test/test0002/hello-amd64.sh | 7 +++--- test/test0002/hello-armv7l.sh | 7 +++--- test/test0002/hello-x86.sh | 7 +++--- test/test0003/hello-aarch64.sh | 7 +++--- test/test0003/hello-amd64.sh | 7 +++--- test/test0003/hello-armv7l.sh | 7 +++--- test/test0003/hello-x86.sh | 7 +++--- test/test0004/hello-aarch64.sh | 7 +++--- test/test0004/hello-amd64.sh | 7 +++--- test/test0004/hello-armv7l.sh | 7 +++--- test/test0004/hello-x86.sh | 7 +++--- test/test0005/hello-aarch64.sh | 7 +++--- test/test0005/hello-amd64.sh | 7 +++--- test/test0005/hello-armv7l.sh | 7 +++--- test/test0005/hello-x86.sh | 7 +++--- test/test0006/hello-aarch64.sh | 7 +++--- test/test0006/hello-amd64.sh | 7 +++--- test/test0006/hello-armv7l.sh | 7 +++--- test/test0006/hello-x86.sh | 7 +++--- test/test0007/hello-aarch64.sh | 7 +++--- test/test0007/hello-amd64.sh | 7 +++--- test/test0007/hello-armv7l.sh | 7 +++--- test/test0007/hello-x86.sh | 7 +++--- test/test0008/hello-aarch64.sh | 7 +++--- test/test0008/hello-amd64.sh | 7 +++--- test/test0008/hello-armv7l.sh | 7 +++--- test/test0008/hello-x86.sh | 7 +++--- test/test0009/hello-aarch64.sh | 7 +++--- test/test0009/hello-amd64.sh | 7 +++--- test/test0009/hello-armv7l.sh | 7 +++--- test/test0009/hello-x86.sh | 7 +++--- test/test0010/hello-aarch64.sh | 7 +++--- test/test0010/hello-amd64.sh | 7 +++--- test/test0010/hello-armv7l.sh | 7 +++--- test/test0010/hello-x86.sh | 7 +++--- test/test0011/hello-aarch64.sh | 7 +++--- test/test0011/hello-amd64.sh | 7 +++--- test/test0011/hello-armv7l.sh | 7 +++--- test/test0011/hello-x86.sh | 7 +++--- test/test0012/hello-aarch64.sh | 7 +++--- test/test0012/hello-amd64.sh | 7 +++--- test/test0012/hello-armv7l.sh | 7 +++--- test/test0012/hello-x86.sh | 7 +++--- test/test0013/hello-aarch64.sh | 7 +++--- test/test0013/hello-amd64.sh | 7 +++--- test/test0013/hello-armv7l.sh | 7 +++--- test/test0013/hello-x86.sh | 7 +++--- test/test0014/hello-aarch64.sh | 7 +++--- test/test0014/hello-amd64.sh | 7 +++--- test/test0014/hello-armv7l.sh | 7 +++--- test/test0014/hello-x86.sh | 7 +++--- test/test0015/hello-aarch64.sh | 7 +++--- test/test0015/hello-amd64.sh | 7 +++--- test/test0015/hello-armv7l.sh | 7 +++--- test/test0015/hello-x86.sh | 7 +++--- test/test0016/hello-aarch64.sh | 7 +++--- test/test0016/hello-amd64.sh | 7 +++--- test/test0016/hello-armv7l.sh | 7 +++--- test/test0016/hello-x86.sh | 7 +++--- test/test0017/hello-aarch64.sh | 7 +++--- test/test0017/hello-amd64.sh | 7 +++--- test/test0017/hello-armv7l.sh | 7 +++--- test/test0017/hello-x86.sh | 7 +++--- test/test0018/hello-aarch64.sh | 7 +++--- test/test0018/hello-amd64.sh | 7 +++--- test/test0018/hello-armv7l.sh | 7 +++--- test/test0018/hello-x86.sh | 7 +++--- test/test0019/hello-aarch64.sh | 7 +++--- test/test0019/hello-amd64.sh | 7 +++--- test/test0019/hello-armv7l.sh | 7 +++--- test/test0019/hello-x86.sh | 7 +++--- test/test0020/hello-aarch64.sh | 7 +++--- test/test0020/hello-amd64.sh | 7 +++--- test/test0020/hello-armv7l.sh | 7 +++--- test/test0020/hello-x86.sh | 7 +++--- test/test0021/hello-aarch64.sh | 7 +++--- test/test0021/hello-amd64.sh | 7 +++--- test/test0021/hello-armv7l.sh | 7 +++--- test/test0021/hello-x86.sh | 7 +++--- test/test0022/hello-aarch64.sh | 7 +++--- test/test0022/hello-amd64.sh | 7 +++--- test/test0022/hello-armv7l.sh | 7 +++--- test/test0022/hello-x86.sh | 7 +++--- test/test0023/hello-aarch64.sh | 7 +++--- test/test0023/hello-amd64.sh | 7 +++--- test/test0023/hello-armv7l.sh | 7 +++--- test/test0023/hello-x86.sh | 7 +++--- test/test0024/hello-aarch64.sh | 7 +++--- test/test0024/hello-amd64.sh | 7 +++--- test/test0024/hello-armv7l.sh | 7 +++--- test/test0024/hello-x86.sh | 7 +++--- test/test0025/hello-aarch64.sh | 7 +++--- test/test0025/hello-amd64.sh | 7 +++--- test/test0025/hello-armv7l.sh | 7 +++--- test/test0025/hello-x86.sh | 7 +++--- test/test0100/hello-aarch64.sh | 7 +++--- test/test0100/hello-amd64.sh | 7 +++--- test/test0100/hello-armv7l.sh | 7 +++--- test/test0100/hello-x86.sh | 7 +++--- test/test0101/hello-aarch64.sh | 7 +++--- test/test0101/hello-amd64.sh | 7 +++--- test/test0101/hello-armv7l.sh | 7 +++--- test/test0101/hello-x86.sh | 7 +++--- test/test0102/hello-aarch64.sh | 9 ++++---- test/test0102/hello-amd64.sh | 9 ++++---- test/test0102/hello-armv7l.sh | 9 ++++---- test/test0102/hello-x86.sh | 9 ++++---- test/test0103/hello-aarch64.sh | 7 +++--- test/test0103/hello-amd64.sh | 7 +++--- test/test0103/hello-armv7l.sh | 7 +++--- test/test0103/hello-x86.sh | 7 +++--- test/test0104/hello-aarch64.sh | 7 +++--- test/test0104/hello-amd64.sh | 7 +++--- test/test0104/hello-armv7l.sh | 7 +++--- test/test0104/hello-x86.sh | 7 +++--- test/test0105/hello-aarch64.sh | 7 +++--- test/test0105/hello-amd64.sh | 7 +++--- test/test0105/hello-armv7l.sh | 7 +++--- test/test0105/hello-x86.sh | 7 +++--- test/test0106/hello-aarch64.sh | 7 +++--- test/test0106/hello-amd64.sh | 7 +++--- test/test0106/hello-armv7l.sh | 7 +++--- test/test0106/hello-x86.sh | 7 +++--- 133 files changed, 572 insertions(+), 400 deletions(-) create mode 100644 test/env.inc.sh diff --git a/test/env.inc.sh b/test/env.inc.sh new file mode 100644 index 0000000..94aff5c --- /dev/null +++ b/test/env.inc.sh @@ -0,0 +1,40 @@ +## Copyright (C) 2021 deesix +## This file is part of M2-Planet. +## +## M2-Planet is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## M2-Planet is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with M2-Planet. If not, see . + +# To be sourced from test scripts, with ARCH already set. + +case "${ARCH}" in + aarch64) + BASE_ADDRESS="0x00400000" + ENDIANNESS_FLAG="--little-endian" + ;; + amd64) + BASE_ADDRESS="0x00600000" + ENDIANNESS_FLAG="--little-endian" + ;; + armv7l) + BASE_ADDRESS="0x00010000" + ENDIANNESS_FLAG="--little-endian" + ;; + x86) + BASE_ADDRESS="0x08048000" + ENDIANNESS_FLAG="--little-endian" + ;; + *) + echo "$0: Unknown architecture (${ARCH})." + exit 77 + ;; +esac diff --git a/test/test0000/hello-aarch64.sh b/test/test0000/hello-aarch64.sh index 05ced42..db5c220 100755 --- a/test/test0000/hello-aarch64.sh +++ b/test/test0000/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0000/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -35,7 +36,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-core.M1 \ -f ${TMPDIR}/return.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/return.hex2 \ || exit 2 @@ -44,9 +45,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/return.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0000-${ARCH}-binary \ || exit 3 diff --git a/test/test0000/hello-amd64.sh b/test/test0000/hello-amd64.sh index fba5a7c..fdce59f 100755 --- a/test/test0000/hello-amd64.sh +++ b/test/test0000/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0000/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -35,7 +36,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-core.M1 \ -f ${TMPDIR}/return.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/return.hex2 \ || exit 2 @@ -44,9 +45,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/return.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0000-${ARCH}-binary \ || exit 3 diff --git a/test/test0000/hello-armv7l.sh b/test/test0000/hello-armv7l.sh index 98e6966..16d4f6d 100755 --- a/test/test0000/hello-armv7l.sh +++ b/test/test0000/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0000/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -35,7 +36,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-core.M1 \ -f ${TMPDIR}/return.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/return.hex2 \ || exit 2 @@ -44,9 +45,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/return.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0000-${ARCH}-binary \ || exit 3 diff --git a/test/test0000/hello-x86.sh b/test/test0000/hello-x86.sh index 42e95c6..8646f64 100755 --- a/test/test0000/hello-x86.sh +++ b/test/test0000/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0000/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -35,7 +36,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-core.M1 \ -f ${TMPDIR}/return.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/return.hex2 \ || exit 2 @@ -44,9 +45,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/return.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0000-${ARCH}-binary \ || exit 3 diff --git a/test/test0001/hello-aarch64.sh b/test/test0001/hello-aarch64.sh index 35183fc..5f5de74 100755 --- a/test/test0001/hello-aarch64.sh +++ b/test/test0001/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0001/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/library_call.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/library_call.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/library_call.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0001-${ARCH}-binary \ || exit 3 diff --git a/test/test0001/hello-amd64.sh b/test/test0001/hello-amd64.sh index 4a7bd5c..11a5e9c 100755 --- a/test/test0001/hello-amd64.sh +++ b/test/test0001/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0001/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/library_call.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/library_call.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/library_call.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0001-${ARCH}-binary \ || exit 3 diff --git a/test/test0001/hello-armv7l.sh b/test/test0001/hello-armv7l.sh index 416d6fd..adb8398 100755 --- a/test/test0001/hello-armv7l.sh +++ b/test/test0001/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0001/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/library_call.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/library_call.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/library_call.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0001-${ARCH}-binary \ || exit 3 diff --git a/test/test0001/hello-x86.sh b/test/test0001/hello-x86.sh index 550ce9b..c8cdfd8 100755 --- a/test/test0001/hello-x86.sh +++ b/test/test0001/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0001/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/library_call.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/library_call.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/library_call.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0001-${ARCH}-binary \ || exit 3 diff --git a/test/test0002/hello-aarch64.sh b/test/test0002/hello-aarch64.sh index 24bfd48..c856ead 100755 --- a/test/test0002/hello-aarch64.sh +++ b/test/test0002/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0002/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/if.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/if.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/if.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0002-${ARCH}-binary \ || exit 3 diff --git a/test/test0002/hello-amd64.sh b/test/test0002/hello-amd64.sh index dd27f19..93f361d 100755 --- a/test/test0002/hello-amd64.sh +++ b/test/test0002/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0002/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/if.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/if.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/if.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0002-${ARCH}-binary \ || exit 3 diff --git a/test/test0002/hello-armv7l.sh b/test/test0002/hello-armv7l.sh index aa15d80..5ce220c 100755 --- a/test/test0002/hello-armv7l.sh +++ b/test/test0002/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0002/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/if.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/if.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/if.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0002-${ARCH}-binary \ || exit 3 diff --git a/test/test0002/hello-x86.sh b/test/test0002/hello-x86.sh index 458f4c0..df9e862 100755 --- a/test/test0002/hello-x86.sh +++ b/test/test0002/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0002/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/if.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/if.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/if.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0002-${ARCH}-binary \ || exit 3 diff --git a/test/test0003/hello-aarch64.sh b/test/test0003/hello-aarch64.sh index 6b42581..db56d12 100755 --- a/test/test0003/hello-aarch64.sh +++ b/test/test0003/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0003/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/constant.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/constant.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/constant.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0003-${ARCH}-binary \ || exit 3 diff --git a/test/test0003/hello-amd64.sh b/test/test0003/hello-amd64.sh index cd3aa20..9cdcbb4 100755 --- a/test/test0003/hello-amd64.sh +++ b/test/test0003/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0003/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/constant.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/constant.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/constant.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0003-${ARCH}-binary \ || exit 3 diff --git a/test/test0003/hello-armv7l.sh b/test/test0003/hello-armv7l.sh index ea65678..a68995b 100755 --- a/test/test0003/hello-armv7l.sh +++ b/test/test0003/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0003/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/constant.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/constant.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/constant.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0003-${ARCH}-binary \ || exit 3 diff --git a/test/test0003/hello-x86.sh b/test/test0003/hello-x86.sh index 42ebd53..cc1aad0 100755 --- a/test/test0003/hello-x86.sh +++ b/test/test0003/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0003/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/constant.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/constant.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/constant.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0003-${ARCH}-binary \ || exit 3 diff --git a/test/test0004/hello-aarch64.sh b/test/test0004/hello-aarch64.sh index 3b95f90..d1cf360 100755 --- a/test/test0004/hello-aarch64.sh +++ b/test/test0004/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0004/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/call.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/call.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/call.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0004-${ARCH}-binary \ || exit 3 diff --git a/test/test0004/hello-amd64.sh b/test/test0004/hello-amd64.sh index a04776b..8ff5d7f 100755 --- a/test/test0004/hello-amd64.sh +++ b/test/test0004/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0004/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/call.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/call.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/call.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0004-${ARCH}-binary \ || exit 3 diff --git a/test/test0004/hello-armv7l.sh b/test/test0004/hello-armv7l.sh index 4ba25d9..a56116a 100755 --- a/test/test0004/hello-armv7l.sh +++ b/test/test0004/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0004/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/call.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/call.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/call.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0004-${ARCH}-binary \ || exit 3 diff --git a/test/test0004/hello-x86.sh b/test/test0004/hello-x86.sh index f4fd9be..c77758c 100755 --- a/test/test0004/hello-x86.sh +++ b/test/test0004/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0004/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/call.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/call.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/call.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0004-${ARCH}-binary \ || exit 3 diff --git a/test/test0005/hello-aarch64.sh b/test/test0005/hello-aarch64.sh index 1edeeed..7b6e651 100755 --- a/test/test0005/hello-aarch64.sh +++ b/test/test0005/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0005/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/string.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/string.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/string.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0005-${ARCH}-binary \ || exit 3 diff --git a/test/test0005/hello-amd64.sh b/test/test0005/hello-amd64.sh index 6a45c8c..774cf72 100755 --- a/test/test0005/hello-amd64.sh +++ b/test/test0005/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0005/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/string.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/string.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/string.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0005-${ARCH}-binary \ || exit 3 diff --git a/test/test0005/hello-armv7l.sh b/test/test0005/hello-armv7l.sh index 26d6d67..8a7849d 100755 --- a/test/test0005/hello-armv7l.sh +++ b/test/test0005/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0005/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/string.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/string.hex2 \ || exit 3 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/string.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0005-${ARCH}-binary \ || exit 4 diff --git a/test/test0005/hello-x86.sh b/test/test0005/hello-x86.sh index e78fdb9..9bee0bb 100755 --- a/test/test0005/hello-x86.sh +++ b/test/test0005/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0005/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/string.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/string.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/string.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0005-${ARCH}-binary \ || exit 3 diff --git a/test/test0006/hello-aarch64.sh b/test/test0006/hello-aarch64.sh index 7fcebc8..5cddd8a 100755 --- a/test/test0006/hello-aarch64.sh +++ b/test/test0006/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0006/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/for.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/for.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/for.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0006-${ARCH}-binary \ || exit 3 diff --git a/test/test0006/hello-amd64.sh b/test/test0006/hello-amd64.sh index 147896a..3c4da79 100755 --- a/test/test0006/hello-amd64.sh +++ b/test/test0006/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0006/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/for.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/for.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/for.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0006-${ARCH}-binary \ || exit 3 diff --git a/test/test0006/hello-armv7l.sh b/test/test0006/hello-armv7l.sh index 6612685..ce3e5ad 100755 --- a/test/test0006/hello-armv7l.sh +++ b/test/test0006/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0006/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/for.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/for.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/for.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0006-${ARCH}-binary \ || exit 3 diff --git a/test/test0006/hello-x86.sh b/test/test0006/hello-x86.sh index 4a69549..e4d150c 100755 --- a/test/test0006/hello-x86.sh +++ b/test/test0006/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0006/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/for.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/for.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/for.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0006-${ARCH}-binary \ || exit 3 diff --git a/test/test0007/hello-aarch64.sh b/test/test0007/hello-aarch64.sh index 1db9cea..fb3b7c2 100755 --- a/test/test0007/hello-aarch64.sh +++ b/test/test0007/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0007/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/do.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/do.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/do.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0007-${ARCH}-binary \ || exit 3 diff --git a/test/test0007/hello-amd64.sh b/test/test0007/hello-amd64.sh index 2d07bc8..ba27958 100755 --- a/test/test0007/hello-amd64.sh +++ b/test/test0007/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0007/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/do.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/do.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/do.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0007-${ARCH}-binary \ || exit 3 diff --git a/test/test0007/hello-armv7l.sh b/test/test0007/hello-armv7l.sh index c0af2b0..944e31a 100755 --- a/test/test0007/hello-armv7l.sh +++ b/test/test0007/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0007/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/do.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/do.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/do.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0007-${ARCH}-binary \ || exit 3 diff --git a/test/test0007/hello-x86.sh b/test/test0007/hello-x86.sh index f281bef..ef6f009 100755 --- a/test/test0007/hello-x86.sh +++ b/test/test0007/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0007/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/do.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/do.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/do.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0007-${ARCH}-binary \ || exit 3 diff --git a/test/test0008/hello-aarch64.sh b/test/test0008/hello-aarch64.sh index 4075d28..d493341 100755 --- a/test/test0008/hello-aarch64.sh +++ b/test/test0008/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0008/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -49,7 +50,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/struct.M1 \ -f ${TMPDIR}/struct-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/struct.hex2 \ || exit 2 @@ -58,9 +59,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0008-${ARCH}-binary \ || exit 3 diff --git a/test/test0008/hello-amd64.sh b/test/test0008/hello-amd64.sh index b5dd80f..5a63eab 100755 --- a/test/test0008/hello-amd64.sh +++ b/test/test0008/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0008/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -49,7 +50,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/struct.M1 \ -f ${TMPDIR}/struct-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/struct.hex2 \ || exit 2 @@ -58,9 +59,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0008-${ARCH}-binary \ || exit 3 diff --git a/test/test0008/hello-armv7l.sh b/test/test0008/hello-armv7l.sh index b89a273..f21c31e 100755 --- a/test/test0008/hello-armv7l.sh +++ b/test/test0008/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0008/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -48,7 +49,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/struct.M1 \ -f ${TMPDIR}/struct-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/struct.hex2 \ || exit 2 @@ -57,9 +58,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0008-${ARCH}-binary \ || exit 3 diff --git a/test/test0008/hello-x86.sh b/test/test0008/hello-x86.sh index d3adf6a..00a7089 100755 --- a/test/test0008/hello-x86.sh +++ b/test/test0008/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0008/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -48,7 +49,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/struct.M1 \ -f ${TMPDIR}/struct-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/struct.hex2 \ || exit 2 @@ -57,9 +58,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0008-${ARCH}-binary \ || exit 3 diff --git a/test/test0009/hello-aarch64.sh b/test/test0009/hello-aarch64.sh index 5c69d89..d71bd6e 100755 --- a/test/test0009/hello-aarch64.sh +++ b/test/test0009/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0009/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/goto.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/goto.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/goto.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0009-${ARCH}-binary \ || exit 3 diff --git a/test/test0009/hello-amd64.sh b/test/test0009/hello-amd64.sh index b857920..9f51526 100755 --- a/test/test0009/hello-amd64.sh +++ b/test/test0009/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0009/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/goto.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/goto.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/goto.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0009-${ARCH}-binary \ || exit 3 diff --git a/test/test0009/hello-armv7l.sh b/test/test0009/hello-armv7l.sh index 2689587..8a7eb88 100755 --- a/test/test0009/hello-armv7l.sh +++ b/test/test0009/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0009/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/goto.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/goto.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/goto.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0009-${ARCH}-binary \ || exit 3 diff --git a/test/test0009/hello-x86.sh b/test/test0009/hello-x86.sh index 5e4b5a8..0aaac3c 100755 --- a/test/test0009/hello-x86.sh +++ b/test/test0009/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0009/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/goto.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/goto.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/goto.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0009-${ARCH}-binary \ || exit 3 diff --git a/test/test0010/hello-aarch64.sh b/test/test0010/hello-aarch64.sh index f01f9f9..a2c0bbe 100755 --- a/test/test0010/hello-aarch64.sh +++ b/test/test0010/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0010/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/nested_struct.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/nested_struct.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/nested_struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0010-${ARCH}-binary \ || exit 3 diff --git a/test/test0010/hello-amd64.sh b/test/test0010/hello-amd64.sh index cba2a57..b7c4e34 100755 --- a/test/test0010/hello-amd64.sh +++ b/test/test0010/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0010/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/nested_struct.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/nested_struct.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/nested_struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0010-${ARCH}-binary \ || exit 3 diff --git a/test/test0010/hello-armv7l.sh b/test/test0010/hello-armv7l.sh index 596f6f9..bb47bf9 100755 --- a/test/test0010/hello-armv7l.sh +++ b/test/test0010/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0010/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/nested_struct.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/nested_struct.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/nested_struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0010-${ARCH}-binary \ || exit 3 diff --git a/test/test0010/hello-x86.sh b/test/test0010/hello-x86.sh index 2bdfc75..180d6ff 100755 --- a/test/test0010/hello-x86.sh +++ b/test/test0010/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0010/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/nested_struct.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/nested_struct.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/nested_struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0010-${ARCH}-binary \ || exit 3 diff --git a/test/test0011/hello-aarch64.sh b/test/test0011/hello-aarch64.sh index 8f76d04..bc26261 100755 --- a/test/test0011/hello-aarch64.sh +++ b/test/test0011/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0011/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-do.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-do.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-do.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0011-${ARCH}-binary \ || exit 3 diff --git a/test/test0011/hello-amd64.sh b/test/test0011/hello-amd64.sh index 4952b3a..1f4579d 100755 --- a/test/test0011/hello-amd64.sh +++ b/test/test0011/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0011/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-do.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-do.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-do.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0011-${ARCH}-binary \ || exit 3 diff --git a/test/test0011/hello-armv7l.sh b/test/test0011/hello-armv7l.sh index 1d411ff..ac34f0b 100755 --- a/test/test0011/hello-armv7l.sh +++ b/test/test0011/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0011/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-do.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-do.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-do.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0011-${ARCH}-binary \ || exit 3 diff --git a/test/test0011/hello-x86.sh b/test/test0011/hello-x86.sh index ec959e8..45f74f2 100755 --- a/test/test0011/hello-x86.sh +++ b/test/test0011/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0011/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-do.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-do.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-do.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0011-${ARCH}-binary \ || exit 3 diff --git a/test/test0012/hello-aarch64.sh b/test/test0012/hello-aarch64.sh index e1c6408..cbbf7ca 100755 --- a/test/test0012/hello-aarch64.sh +++ b/test/test0012/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0012/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-for.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-for.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-for.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0012-${ARCH}-binary \ || exit 3 diff --git a/test/test0012/hello-amd64.sh b/test/test0012/hello-amd64.sh index c0709e8..0926b8d 100755 --- a/test/test0012/hello-amd64.sh +++ b/test/test0012/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0012/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-for.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-for.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-for.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0012-${ARCH}-binary \ || exit 3 diff --git a/test/test0012/hello-armv7l.sh b/test/test0012/hello-armv7l.sh index 19ce0fc..5fa9099 100755 --- a/test/test0012/hello-armv7l.sh +++ b/test/test0012/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0012/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-for.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-for.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-for.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0012-${ARCH}-binary \ || exit 3 diff --git a/test/test0012/hello-x86.sh b/test/test0012/hello-x86.sh index 144b722..a073678 100755 --- a/test/test0012/hello-x86.sh +++ b/test/test0012/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0012/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-for.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-for.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-for.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0012-${ARCH}-binary \ || exit 3 diff --git a/test/test0013/hello-aarch64.sh b/test/test0013/hello-aarch64.sh index f73e5b7..e16336a 100755 --- a/test/test0013/hello-aarch64.sh +++ b/test/test0013/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0013/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-while.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-while.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-while.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0013-${ARCH}-binary \ || exit 3 diff --git a/test/test0013/hello-amd64.sh b/test/test0013/hello-amd64.sh index cc8d459..68961fb 100755 --- a/test/test0013/hello-amd64.sh +++ b/test/test0013/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0013/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-while.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-while.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-while.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0013-${ARCH}-binary \ || exit 3 diff --git a/test/test0013/hello-armv7l.sh b/test/test0013/hello-armv7l.sh index 009fcd1..77baeaa 100755 --- a/test/test0013/hello-armv7l.sh +++ b/test/test0013/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0013/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-while.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-while.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-while.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0013-${ARCH}-binary \ || exit 3 diff --git a/test/test0013/hello-x86.sh b/test/test0013/hello-x86.sh index 2fe415b..fe26046 100755 --- a/test/test0013/hello-x86.sh +++ b/test/test0013/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0013/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/break-while.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/break-while.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/break-while.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0013-${ARCH}-binary \ || exit 3 diff --git a/test/test0014/hello-aarch64.sh b/test/test0014/hello-aarch64.sh index 43284c2..20212f9 100755 --- a/test/test0014/hello-aarch64.sh +++ b/test/test0014/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0014/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/basic_args.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/basic_args.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/basic_args.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0014-${ARCH}-binary \ || exit 3 diff --git a/test/test0014/hello-amd64.sh b/test/test0014/hello-amd64.sh index 71a8177..fdfc070 100755 --- a/test/test0014/hello-amd64.sh +++ b/test/test0014/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0014/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/basic_args.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/basic_args.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/basic_args.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0014-${ARCH}-binary \ || exit 3 diff --git a/test/test0014/hello-armv7l.sh b/test/test0014/hello-armv7l.sh index a467a4e..b7473de 100755 --- a/test/test0014/hello-armv7l.sh +++ b/test/test0014/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0014/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/basic_args.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/basic_args.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/basic_args.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0014-${ARCH}-binary \ || exit 3 diff --git a/test/test0014/hello-x86.sh b/test/test0014/hello-x86.sh index 82c5f52..6d8c11a 100755 --- a/test/test0014/hello-x86.sh +++ b/test/test0014/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0014/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/basic_args.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/basic_args.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/basic_args.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0014-${ARCH}-binary \ || exit 3 diff --git a/test/test0015/hello-aarch64.sh b/test/test0015/hello-aarch64.sh index 56c18f5..982add3 100755 --- a/test/test0015/hello-aarch64.sh +++ b/test/test0015/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0015/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/file_read.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/file_read.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/file_read.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0015-${ARCH}-binary \ || exit 3 diff --git a/test/test0015/hello-amd64.sh b/test/test0015/hello-amd64.sh index 3e33b18..c912d39 100755 --- a/test/test0015/hello-amd64.sh +++ b/test/test0015/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0015/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/file_read.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/file_read.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/file_read.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0015-${ARCH}-binary \ || exit 3 diff --git a/test/test0015/hello-armv7l.sh b/test/test0015/hello-armv7l.sh index 56a372a..18f8b91 100755 --- a/test/test0015/hello-armv7l.sh +++ b/test/test0015/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0015/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/file_read.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/file_read.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/file_read.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0015-${ARCH}-binary \ || exit 3 diff --git a/test/test0015/hello-x86.sh b/test/test0015/hello-x86.sh index e580034..a921f1c 100755 --- a/test/test0015/hello-x86.sh +++ b/test/test0015/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0015/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/file_read.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/file_read.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/file_read.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0015-${ARCH}-binary \ || exit 3 diff --git a/test/test0016/hello-aarch64.sh b/test/test0016/hello-aarch64.sh index d500662..3fb68ed 100755 --- a/test/test0016/hello-aarch64.sh +++ b/test/test0016/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0016/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/file_write.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/file_write.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/file_write.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0016-${ARCH}-binary \ || exit 3 diff --git a/test/test0016/hello-amd64.sh b/test/test0016/hello-amd64.sh index 0f0e772..7d1f617 100755 --- a/test/test0016/hello-amd64.sh +++ b/test/test0016/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0016/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/file_write.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/file_write.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/file_write.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0016-${ARCH}-binary \ || exit 3 diff --git a/test/test0016/hello-armv7l.sh b/test/test0016/hello-armv7l.sh index 10e6a05..6b4c956 100755 --- a/test/test0016/hello-armv7l.sh +++ b/test/test0016/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0016/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/file_write.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/file_write.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/file_write.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0016-${ARCH}-binary \ || exit 3 diff --git a/test/test0016/hello-x86.sh b/test/test0016/hello-x86.sh index b113870..485fac5 100755 --- a/test/test0016/hello-x86.sh +++ b/test/test0016/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0016/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/file_write.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/file_write.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/file_write.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0016-${ARCH}-binary \ || exit 3 diff --git a/test/test0017/hello-aarch64.sh b/test/test0017/hello-aarch64.sh index e041582..a8a800d 100755 --- a/test/test0017/hello-aarch64.sh +++ b/test/test0017/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0017/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/memset.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/memset.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/memset.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0017-${ARCH}-binary \ || exit 3 diff --git a/test/test0017/hello-amd64.sh b/test/test0017/hello-amd64.sh index 4d0d284..4a04fa1 100755 --- a/test/test0017/hello-amd64.sh +++ b/test/test0017/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0017/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/memset.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/memset.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/memset.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0017-${ARCH}-binary \ || exit 3 diff --git a/test/test0017/hello-armv7l.sh b/test/test0017/hello-armv7l.sh index d43daff..4af7621 100755 --- a/test/test0017/hello-armv7l.sh +++ b/test/test0017/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0017/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/memset.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/memset.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/memset.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0017-${ARCH}-binary \ || exit 3 diff --git a/test/test0017/hello-x86.sh b/test/test0017/hello-x86.sh index 2176f9b..13283ab 100755 --- a/test/test0017/hello-x86.sh +++ b/test/test0017/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0017/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/memset.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/memset.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/memset.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0017-${ARCH}-binary \ || exit 3 diff --git a/test/test0018/hello-aarch64.sh b/test/test0018/hello-aarch64.sh index d949c26..6aed276 100755 --- a/test/test0018/hello-aarch64.sh +++ b/test/test0018/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0018/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/math.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/math.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/math.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0018-${ARCH}-binary \ || exit 3 diff --git a/test/test0018/hello-amd64.sh b/test/test0018/hello-amd64.sh index f4d77c0..1a3603f 100755 --- a/test/test0018/hello-amd64.sh +++ b/test/test0018/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0018/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/math.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/math.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/math.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0018-${ARCH}-binary \ || exit 3 diff --git a/test/test0018/hello-armv7l.sh b/test/test0018/hello-armv7l.sh index a731ae2..0985213 100755 --- a/test/test0018/hello-armv7l.sh +++ b/test/test0018/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0018/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/math.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/math.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/math.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0018-${ARCH}-binary \ || exit 3 diff --git a/test/test0018/hello-x86.sh b/test/test0018/hello-x86.sh index 5878d74..4a7f6fe 100755 --- a/test/test0018/hello-x86.sh +++ b/test/test0018/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0018/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/math.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/math.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/math.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0018-${ARCH}-binary \ || exit 3 diff --git a/test/test0019/hello-aarch64.sh b/test/test0019/hello-aarch64.sh index b7449dc..26dc1f7 100755 --- a/test/test0019/hello-aarch64.sh +++ b/test/test0019/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0019/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -43,7 +44,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/getopt.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/getopt.hex2 \ || exit 2 @@ -52,9 +53,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/getopt.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0019-${ARCH}-binary \ || exit 3 diff --git a/test/test0019/hello-amd64.sh b/test/test0019/hello-amd64.sh index 6f7933a..f84a032 100755 --- a/test/test0019/hello-amd64.sh +++ b/test/test0019/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0019/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -43,7 +44,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/getopt.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/getopt.hex2 \ || exit 2 @@ -52,9 +53,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/getopt.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0019-${ARCH}-binary \ || exit 3 diff --git a/test/test0019/hello-armv7l.sh b/test/test0019/hello-armv7l.sh index 7c7fbc5..e362ba5 100755 --- a/test/test0019/hello-armv7l.sh +++ b/test/test0019/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0019/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -43,7 +44,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/getopt.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/getopt.hex2 \ || exit 2 @@ -52,9 +53,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/getopt.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0019-${ARCH}-binary \ || exit 3 diff --git a/test/test0019/hello-x86.sh b/test/test0019/hello-x86.sh index 1bf49fa..8951900 100755 --- a/test/test0019/hello-x86.sh +++ b/test/test0019/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0019/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -43,7 +44,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/getopt.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/getopt.hex2 \ || exit 2 @@ -52,9 +53,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/getopt.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0019-${ARCH}-binary \ || exit 3 diff --git a/test/test0020/hello-aarch64.sh b/test/test0020/hello-aarch64.sh index 21f88e4..91f9bae 100755 --- a/test/test0020/hello-aarch64.sh +++ b/test/test0020/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0020/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/struct.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/struct.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0020-${ARCH}-binary \ || exit 3 diff --git a/test/test0020/hello-amd64.sh b/test/test0020/hello-amd64.sh index 4092ec3..e70dfb7 100755 --- a/test/test0020/hello-amd64.sh +++ b/test/test0020/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0020/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/struct.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/struct.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0020-${ARCH}-binary \ || exit 3 diff --git a/test/test0020/hello-armv7l.sh b/test/test0020/hello-armv7l.sh index 835da67..6180e2f 100755 --- a/test/test0020/hello-armv7l.sh +++ b/test/test0020/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0020/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/struct.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/struct.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0020-${ARCH}-binary \ || exit 3 diff --git a/test/test0020/hello-x86.sh b/test/test0020/hello-x86.sh index 9655845..cece07b 100755 --- a/test/test0020/hello-x86.sh +++ b/test/test0020/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0020/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/struct.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/struct.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/struct.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0020-${ARCH}-binary \ || exit 3 diff --git a/test/test0021/hello-aarch64.sh b/test/test0021/hello-aarch64.sh index 6d3e899..5f21515 100755 --- a/test/test0021/hello-aarch64.sh +++ b/test/test0021/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0021/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -51,7 +52,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/chdir.M1 \ -f ${TMPDIR}/chdir-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/chdir.hex2 \ || exit 3 @@ -60,9 +61,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/chdir.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0021-${ARCH}-binary \ || exit 4 diff --git a/test/test0021/hello-amd64.sh b/test/test0021/hello-amd64.sh index 23f3ea5..8ae9506 100755 --- a/test/test0021/hello-amd64.sh +++ b/test/test0021/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0021/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -51,7 +52,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/chdir.M1 \ -f ${TMPDIR}/chdir-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/chdir.hex2 \ || exit 3 @@ -60,9 +61,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/chdir.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0021-${ARCH}-binary \ || exit 4 diff --git a/test/test0021/hello-armv7l.sh b/test/test0021/hello-armv7l.sh index 3d22e33..11c2ce1 100755 --- a/test/test0021/hello-armv7l.sh +++ b/test/test0021/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0021/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -50,7 +51,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/chdir.M1 \ -f ${TMPDIR}/chdir-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/chdir.hex2 \ || exit 3 @@ -59,9 +60,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/chdir.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0021-${ARCH}-binary \ || exit 4 diff --git a/test/test0021/hello-x86.sh b/test/test0021/hello-x86.sh index a0ec696..e3c7a5f 100755 --- a/test/test0021/hello-x86.sh +++ b/test/test0021/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0021/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -50,7 +51,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/chdir.M1 \ -f ${TMPDIR}/chdir-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/chdir.hex2 \ || exit 3 @@ -59,9 +60,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/chdir.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0021-${ARCH}-binary \ || exit 4 diff --git a/test/test0022/hello-aarch64.sh b/test/test0022/hello-aarch64.sh index 350343f..15705c0 100755 --- a/test/test0022/hello-aarch64.sh +++ b/test/test0022/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0022/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -52,7 +53,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/continue.M1 \ -f ${TMPDIR}/continue-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/continue.hex2 \ || exit 3 @@ -61,9 +62,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/continue.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0022-${ARCH}-binary \ || exit 4 diff --git a/test/test0022/hello-amd64.sh b/test/test0022/hello-amd64.sh index 4c9f7e7..04e786f 100755 --- a/test/test0022/hello-amd64.sh +++ b/test/test0022/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0022/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -52,7 +53,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/continue.M1 \ -f ${TMPDIR}/continue-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/continue.hex2 \ || exit 3 @@ -61,9 +62,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/continue.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0022-${ARCH}-binary \ || exit 4 diff --git a/test/test0022/hello-armv7l.sh b/test/test0022/hello-armv7l.sh index 076b3d3..aa46562 100755 --- a/test/test0022/hello-armv7l.sh +++ b/test/test0022/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0022/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -51,7 +52,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/continue.M1 \ -f ${TMPDIR}/continue-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/continue.hex2 \ || exit 3 @@ -60,9 +61,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/continue.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0022-${ARCH}-binary \ || exit 4 diff --git a/test/test0022/hello-x86.sh b/test/test0022/hello-x86.sh index a1fb246..4113fbf 100755 --- a/test/test0022/hello-x86.sh +++ b/test/test0022/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0022/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -51,7 +52,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/continue.M1 \ -f ${TMPDIR}/continue-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/continue.hex2 \ || exit 3 @@ -60,9 +61,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/continue.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0022-${ARCH}-binary \ || exit 4 diff --git a/test/test0023/hello-aarch64.sh b/test/test0023/hello-aarch64.sh index 0ca88b5..b238250 100755 --- a/test/test0023/hello-aarch64.sh +++ b/test/test0023/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0023/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -49,7 +50,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/fseek.M1 \ -f ${TMPDIR}/fseek-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/fseek.hex2 \ || exit 3 @@ -58,9 +59,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/fseek.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0023-${ARCH}-binary \ || exit 4 diff --git a/test/test0023/hello-amd64.sh b/test/test0023/hello-amd64.sh index 19ac832..c20b937 100755 --- a/test/test0023/hello-amd64.sh +++ b/test/test0023/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0023/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -49,7 +50,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/fseek.M1 \ -f ${TMPDIR}/fseek-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/fseek.hex2 \ || exit 3 @@ -58,9 +59,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/fseek.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0023-${ARCH}-binary \ || exit 4 diff --git a/test/test0023/hello-armv7l.sh b/test/test0023/hello-armv7l.sh index 834d14d..9ededd5 100755 --- a/test/test0023/hello-armv7l.sh +++ b/test/test0023/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0023/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -48,7 +49,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/fseek.M1 \ -f ${TMPDIR}/fseek-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/fseek.hex2 \ || exit 3 @@ -57,9 +58,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/fseek.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0023-${ARCH}-binary \ || exit 4 diff --git a/test/test0023/hello-x86.sh b/test/test0023/hello-x86.sh index 1b46406..3c6f774 100755 --- a/test/test0023/hello-x86.sh +++ b/test/test0023/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0023/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -48,7 +49,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/fseek.M1 \ -f ${TMPDIR}/fseek-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/fseek.hex2 \ || exit 3 @@ -57,9 +58,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/fseek.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0023-${ARCH}-binary \ || exit 4 diff --git a/test/test0024/hello-aarch64.sh b/test/test0024/hello-aarch64.sh index 9643b5e..013faf8 100755 --- a/test/test0024/hello-aarch64.sh +++ b/test/test0024/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0024/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -35,7 +36,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-core.M1 \ -f ${TMPDIR}/return.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/return.hex2 \ || exit 2 @@ -44,9 +45,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/return.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0024-${ARCH}-binary \ || exit 3 diff --git a/test/test0024/hello-amd64.sh b/test/test0024/hello-amd64.sh index 04d99f5..eb5d975 100755 --- a/test/test0024/hello-amd64.sh +++ b/test/test0024/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0024/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -35,7 +36,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-core.M1 \ -f ${TMPDIR}/return.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/return.hex2 \ || exit 2 @@ -44,9 +45,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/return.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0024-${ARCH}-binary \ || exit 3 diff --git a/test/test0024/hello-armv7l.sh b/test/test0024/hello-armv7l.sh index 1ce2034..a3e0690 100755 --- a/test/test0024/hello-armv7l.sh +++ b/test/test0024/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0024/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -35,7 +36,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-core.M1 \ -f ${TMPDIR}/return.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/return.hex2 \ || exit 2 @@ -44,9 +45,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/return.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0024-${ARCH}-binary \ || exit 3 diff --git a/test/test0024/hello-x86.sh b/test/test0024/hello-x86.sh index f6803af..dee960c 100755 --- a/test/test0024/hello-x86.sh +++ b/test/test0024/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0024/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -35,7 +36,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-core.M1 \ -f ${TMPDIR}/return.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/return.hex2 \ || exit 2 @@ -44,9 +45,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/return.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0024-${ARCH}-binary \ || exit 3 diff --git a/test/test0025/hello-aarch64.sh b/test/test0025/hello-aarch64.sh index 5f84e11..dbea8e5 100755 --- a/test/test0025/hello-aarch64.sh +++ b/test/test0025/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0025/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -49,7 +50,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/array.M1 \ -f ${TMPDIR}/array-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/array.hex2 \ || exit 2 @@ -58,9 +59,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/array.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0025-${ARCH}-binary \ || exit 3 diff --git a/test/test0025/hello-amd64.sh b/test/test0025/hello-amd64.sh index b317dc3..147f342 100755 --- a/test/test0025/hello-amd64.sh +++ b/test/test0025/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0025/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -49,7 +50,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/array.M1 \ -f ${TMPDIR}/array-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/array.hex2 \ || exit 2 @@ -58,9 +59,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/array.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0025-${ARCH}-binary \ || exit 3 diff --git a/test/test0025/hello-armv7l.sh b/test/test0025/hello-armv7l.sh index cd9e7b7..b7d2f63 100755 --- a/test/test0025/hello-armv7l.sh +++ b/test/test0025/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0025/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -48,7 +49,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/array.M1 \ -f ${TMPDIR}/array-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/array.hex2 \ || exit 2 @@ -57,9 +58,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/array.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0025-${ARCH}-binary \ || exit 3 diff --git a/test/test0025/hello-x86.sh b/test/test0025/hello-x86.sh index 0e80ca1..c55a601 100755 --- a/test/test0025/hello-x86.sh +++ b/test/test0025/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0025/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -48,7 +49,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/array.M1 \ -f ${TMPDIR}/array-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/array.hex2 \ || exit 2 @@ -57,9 +58,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/array.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0025-${ARCH}-binary \ || exit 3 diff --git a/test/test0100/hello-aarch64.sh b/test/test0100/hello-aarch64.sh index 8ceb35b..190ef03 100755 --- a/test/test0100/hello-aarch64.sh +++ b/test/test0100/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0100/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -51,7 +52,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/blood-elf.M1 \ -f ${TMPDIR}/blood-elf-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/blood-elf.hex2 \ || exit 3 @@ -60,9 +61,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/blood-elf.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0100-${ARCH}-binary \ || exit 4 diff --git a/test/test0100/hello-amd64.sh b/test/test0100/hello-amd64.sh index bbadfb8..ea14fff 100755 --- a/test/test0100/hello-amd64.sh +++ b/test/test0100/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0100/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -51,7 +52,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/blood-elf.M1 \ -f ${TMPDIR}/blood-elf-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/blood-elf.hex2 \ || exit 3 @@ -60,9 +61,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/blood-elf.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0100-${ARCH}-binary \ || exit 4 diff --git a/test/test0100/hello-armv7l.sh b/test/test0100/hello-armv7l.sh index 721184b..ce19b01 100755 --- a/test/test0100/hello-armv7l.sh +++ b/test/test0100/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0100/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -50,7 +51,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/blood-elf.M1 \ -f ${TMPDIR}/blood-elf-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/blood-elf.hex2 \ || exit 3 @@ -59,9 +60,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/blood-elf.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0100-${ARCH}-binary \ || exit 4 diff --git a/test/test0100/hello-x86.sh b/test/test0100/hello-x86.sh index 735880a..ed7e40a 100755 --- a/test/test0100/hello-x86.sh +++ b/test/test0100/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0100/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -50,7 +51,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/blood-elf.M1 \ -f ${TMPDIR}/blood-elf-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/blood-elf.hex2 \ || exit 3 @@ -59,9 +60,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/blood-elf.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0100-${ARCH}-binary \ || exit 4 diff --git a/test/test0101/hello-aarch64.sh b/test/test0101/hello-aarch64.sh index 8767063..48bfc78 100755 --- a/test/test0101/hello-aarch64.sh +++ b/test/test0101/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0101/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -53,7 +54,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/hex2_linker.M1 \ -f ${TMPDIR}/hex2_linker-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/hex2_linker.hex2 \ || exit 3 @@ -62,9 +63,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/hex2_linker.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0101-${ARCH}-binary \ || exit 4 diff --git a/test/test0101/hello-amd64.sh b/test/test0101/hello-amd64.sh index f13c9c5..2ec4cc8 100755 --- a/test/test0101/hello-amd64.sh +++ b/test/test0101/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0101/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -53,7 +54,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/hex2_linker.M1 \ -f ${TMPDIR}/hex2_linker-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/hex2_linker.hex2 \ || exit 3 @@ -62,9 +63,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/hex2_linker.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0101-${ARCH}-binary \ || exit 4 diff --git a/test/test0101/hello-armv7l.sh b/test/test0101/hello-armv7l.sh index f237fb9..294e725 100755 --- a/test/test0101/hello-armv7l.sh +++ b/test/test0101/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0101/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -52,7 +53,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/hex2_linker.M1 \ -f ${TMPDIR}/hex2_linker-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/hex2_linker.hex2 \ || exit 3 @@ -61,9 +62,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/hex2_linker.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0101-${ARCH}-binary \ || exit 4 diff --git a/test/test0101/hello-x86.sh b/test/test0101/hello-x86.sh index 76796a8..b19b2bf 100755 --- a/test/test0101/hello-x86.sh +++ b/test/test0101/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0101/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -52,7 +53,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/hex2_linker.M1 \ -f ${TMPDIR}/hex2_linker-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/hex2_linker.hex2 \ || exit 3 @@ -61,9 +62,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/hex2_linker.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0101-${ARCH}-binary \ || exit 4 diff --git a/test/test0102/hello-aarch64.sh b/test/test0102/hello-aarch64.sh index af10933..c2513c0 100755 --- a/test/test0102/hello-aarch64.sh +++ b/test/test0102/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0102/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -55,7 +56,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/M1-macro.M1 \ -f ${TMPDIR}/M1-macro-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/M1-macro.hex2 \ || exit 3 @@ -64,9 +65,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/M1-macro.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0102-${ARCH}-binary \ || exit 4 @@ -83,7 +84,7 @@ then -f M2libc/x86/x86_defs.M1 \ -f M2libc/x86/libc-core.M1 \ -f test/test0100/test.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture x86 \ -o test/test0102/proof \ || exit 7 diff --git a/test/test0102/hello-amd64.sh b/test/test0102/hello-amd64.sh index b969022..5b6afa3 100755 --- a/test/test0102/hello-amd64.sh +++ b/test/test0102/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0102/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -55,7 +56,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/M1-macro.M1 \ -f ${TMPDIR}/M1-macro-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/M1-macro.hex2 \ || exit 3 @@ -64,9 +65,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/M1-macro.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0102-${ARCH}-binary \ || exit 4 @@ -83,7 +84,7 @@ then -f M2libc/x86/x86_defs.M1 \ -f M2libc/x86/libc-core.M1 \ -f test/test0100/test.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture x86 \ -o test/test0102/proof \ || exit 7 diff --git a/test/test0102/hello-armv7l.sh b/test/test0102/hello-armv7l.sh index 03c1d5e..12f4258 100755 --- a/test/test0102/hello-armv7l.sh +++ b/test/test0102/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0102/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -54,7 +55,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/M1-macro.M1 \ -f ${TMPDIR}/M1-macro-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/M1-macro.hex2 \ || exit 3 @@ -63,9 +64,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/M1-macro.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0102-${ARCH}-binary \ || exit 4 @@ -82,7 +83,7 @@ then -f M2libc/x86/x86_defs.M1 \ -f M2libc/x86/libc-core.M1 \ -f test/test0100/test.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture x86 \ -o test/test0102/proof \ || exit 7 diff --git a/test/test0102/hello-x86.sh b/test/test0102/hello-x86.sh index 6b9e9b3..39d00b7 100755 --- a/test/test0102/hello-x86.sh +++ b/test/test0102/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0102/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -54,7 +55,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/M1-macro.M1 \ -f ${TMPDIR}/M1-macro-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/M1-macro.hex2 \ || exit 3 @@ -63,9 +64,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/M1-macro.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0102-${ARCH}-binary \ || exit 4 @@ -82,7 +83,7 @@ then -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-core.M1 \ -f test/test0100/test.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o test/test0102/proof \ || exit 7 diff --git a/test/test0103/hello-aarch64.sh b/test/test0103/hello-aarch64.sh index 318fc5f..e2b0eb6 100755 --- a/test/test0103/hello-aarch64.sh +++ b/test/test0103/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0103/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -51,7 +52,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/get_machine.M1 \ -f ${TMPDIR}/get_machine-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/get_machine.hex2 \ || exit 3 @@ -60,9 +61,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/get_machine.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0103-${ARCH}-binary \ || exit 4 diff --git a/test/test0103/hello-amd64.sh b/test/test0103/hello-amd64.sh index 61b0f0c..1c21cc3 100755 --- a/test/test0103/hello-amd64.sh +++ b/test/test0103/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0103/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -51,7 +52,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/get_machine.M1 \ -f ${TMPDIR}/get_machine-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/get_machine.hex2 \ || exit 3 @@ -60,9 +61,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/get_machine.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0103-${ARCH}-binary \ || exit 4 diff --git a/test/test0103/hello-armv7l.sh b/test/test0103/hello-armv7l.sh index 680fd2a..0a3bf74 100755 --- a/test/test0103/hello-armv7l.sh +++ b/test/test0103/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0103/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -50,7 +51,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/get_machine.M1 \ -f ${TMPDIR}/get_machine-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/get_machine.hex2 \ || exit 3 @@ -59,9 +60,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/get_machine.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0103-${ARCH}-binary \ || exit 4 diff --git a/test/test0103/hello-x86.sh b/test/test0103/hello-x86.sh index f17a31a..ba27295 100755 --- a/test/test0103/hello-x86.sh +++ b/test/test0103/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0103/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -50,7 +51,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/get_machine.M1 \ -f ${TMPDIR}/get_machine-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/get_machine.hex2 \ || exit 3 @@ -59,9 +60,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/get_machine.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0103-${ARCH}-binary \ || exit 4 diff --git a/test/test0104/hello-aarch64.sh b/test/test0104/hello-aarch64.sh index 4dd82a8..a03f847 100755 --- a/test/test0104/hello-aarch64.sh +++ b/test/test0104/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0104/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -53,7 +54,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/kaem.M1 \ -f ${TMPDIR}/kaem-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/kaem.hex2 \ || exit 3 @@ -62,9 +63,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/kaem.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0104-${ARCH}-binary \ || exit 4 diff --git a/test/test0104/hello-amd64.sh b/test/test0104/hello-amd64.sh index 14623b1..603fc68 100755 --- a/test/test0104/hello-amd64.sh +++ b/test/test0104/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0104/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -53,7 +54,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/kaem.M1 \ -f ${TMPDIR}/kaem-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/kaem.hex2 \ || exit 3 @@ -62,9 +63,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/kaem.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0104-${ARCH}-binary \ || exit 4 diff --git a/test/test0104/hello-armv7l.sh b/test/test0104/hello-armv7l.sh index 09c996c..38899d0 100755 --- a/test/test0104/hello-armv7l.sh +++ b/test/test0104/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0104/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -52,7 +53,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/kaem.M1 \ -f ${TMPDIR}/kaem-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/kaem.hex2 \ || exit 3 @@ -61,9 +62,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/kaem.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0104-${ARCH}-binary \ || exit 4 diff --git a/test/test0104/hello-x86.sh b/test/test0104/hello-x86.sh index e97d0d5..196f6c3 100755 --- a/test/test0104/hello-x86.sh +++ b/test/test0104/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0104/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -52,7 +53,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/kaem.M1 \ -f ${TMPDIR}/kaem-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/kaem.hex2 \ || exit 3 @@ -61,9 +62,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/kaem.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0104-${ARCH}-binary \ || exit 4 diff --git a/test/test0105/hello-aarch64.sh b/test/test0105/hello-aarch64.sh index e85aa16..7c6a3c8 100755 --- a/test/test0105/hello-aarch64.sh +++ b/test/test0105/hello-aarch64.sh @@ -19,6 +19,7 @@ set -x ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0105/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -58,7 +59,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/lisp.M1 \ -f ${TMPDIR}/lisp-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/lisp.hex2 \ || exit 3 @@ -67,9 +68,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/lisp.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0105-${ARCH}-binary \ || exit 4 diff --git a/test/test0105/hello-amd64.sh b/test/test0105/hello-amd64.sh index 583f79e..2dbbbe3 100755 --- a/test/test0105/hello-amd64.sh +++ b/test/test0105/hello-amd64.sh @@ -19,6 +19,7 @@ set -x ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0105/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -58,7 +59,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/lisp.M1 \ -f ${TMPDIR}/lisp-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/lisp.hex2 \ || exit 3 @@ -67,9 +68,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/lisp.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0105-${ARCH}-binary \ || exit 4 diff --git a/test/test0105/hello-armv7l.sh b/test/test0105/hello-armv7l.sh index 5ad6e00..1a6439d 100755 --- a/test/test0105/hello-armv7l.sh +++ b/test/test0105/hello-armv7l.sh @@ -19,6 +19,7 @@ set -x ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0105/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -57,7 +58,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/lisp.M1 \ -f ${TMPDIR}/lisp-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/lisp.hex2 \ || exit 3 @@ -66,9 +67,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/lisp.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0105-${ARCH}-binary \ || exit 4 diff --git a/test/test0105/hello-x86.sh b/test/test0105/hello-x86.sh index 7b193e2..75e289a 100755 --- a/test/test0105/hello-x86.sh +++ b/test/test0105/hello-x86.sh @@ -19,6 +19,7 @@ set -x ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0105/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -57,7 +58,7 @@ M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/lisp.M1 \ -f ${TMPDIR}/lisp-footer.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/lisp.hex2 \ || exit 3 @@ -66,9 +67,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ -f ${TMPDIR}/lisp.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0105-${ARCH}-binary \ || exit 4 diff --git a/test/test0106/hello-aarch64.sh b/test/test0106/hello-aarch64.sh index e15b493..7fd303b 100755 --- a/test/test0106/hello-aarch64.sh +++ b/test/test0106/hello-aarch64.sh @@ -19,6 +19,7 @@ set -ex ARCH="aarch64" +. test/env.inc.sh TMPDIR="test/test0106/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/cc0.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/cc0.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/cc0.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x400000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0106-${ARCH}-binary \ || exit 3 diff --git a/test/test0106/hello-amd64.sh b/test/test0106/hello-amd64.sh index fa071cb..46ec793 100755 --- a/test/test0106/hello-amd64.sh +++ b/test/test0106/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex ARCH="amd64" +. test/env.inc.sh TMPDIR="test/test0106/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/cc0.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/cc0.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/cc0.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x00600000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0106-${ARCH}-binary \ || exit 3 diff --git a/test/test0106/hello-armv7l.sh b/test/test0106/hello-armv7l.sh index d9557a0..6269465 100755 --- a/test/test0106/hello-armv7l.sh +++ b/test/test0106/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex ARCH="armv7l" +. test/env.inc.sh TMPDIR="test/test0106/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/cc0.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/cc0.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/cc0.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x10000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0106-${ARCH}-binary \ || exit 3 diff --git a/test/test0106/hello-x86.sh b/test/test0106/hello-x86.sh index de49ea6..b6866ff 100755 --- a/test/test0106/hello-x86.sh +++ b/test/test0106/hello-x86.sh @@ -19,6 +19,7 @@ set -ex ARCH="x86" +. test/env.inc.sh TMPDIR="test/test0106/tmp-${ARCH}" mkdir -p ${TMPDIR} @@ -39,7 +40,7 @@ M1 \ -f M2libc/${ARCH}/${ARCH}_defs.M1 \ -f M2libc/${ARCH}/libc-full.M1 \ -f ${TMPDIR}/cc0.M1 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ -o ${TMPDIR}/cc0.hex2 \ || exit 2 @@ -48,9 +49,9 @@ M1 \ hex2 \ -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ -f ${TMPDIR}/cc0.hex2 \ - --little-endian \ + ${ENDIANNESS_FLAG} \ --architecture ${ARCH} \ - --base-address 0x8048000 \ + --base-address ${BASE_ADDRESS} \ -o test/results/test0106-${ARCH}-binary \ || exit 3 From 05d962fcfc9e186079f3e77bd2b6b377ca8ccbe3 Mon Sep 17 00:00:00 2001 From: deesix Date: Sun, 31 Jan 2021 00:00:00 +0100 Subject: [PATCH 06/10] @@@ unify 64 bits archs (run_test.sh) --- makefile-tests | 132 +++++++++--------- test/test0000/hello-amd64.sh | 61 -------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0001/hello-amd64.sh | 66 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0002/hello-amd64.sh | 66 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0003/hello-amd64.sh | 66 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0004/hello-amd64.sh | 66 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0005/hello-amd64.sh | 66 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0006/hello-amd64.sh | 67 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0007/hello-amd64.sh | 67 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0008/hello-amd64.sh | 76 ---------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0009/hello-amd64.sh | 66 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0010/hello-amd64.sh | 66 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0011/hello-amd64.sh | 67 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0012/hello-amd64.sh | 67 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0013/hello-amd64.sh | 67 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0014/hello-amd64.sh | 67 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0015/hello-amd64.sh | 67 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0016/hello-amd64.sh | 67 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0017/hello-amd64.sh | 67 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0018/hello-amd64.sh | 67 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0019/hello-amd64.sh | 71 ---------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0020/hello-amd64.sh | 66 --------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0021/hello-aarch64.sh | 78 ----------- test/test0021/{hello-amd64.sh => run_test.sh} | 2 +- test/test0022/hello-aarch64.sh | 81 ----------- test/test0022/{hello-amd64.sh => run_test.sh} | 2 +- test/test0023/hello-aarch64.sh | 78 ----------- test/test0023/{hello-amd64.sh => run_test.sh} | 2 +- test/test0024/hello-amd64.sh | 61 -------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0025/hello-amd64.sh | 77 ---------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0100/hello-amd64.sh | 85 ----------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0101/hello-amd64.sh | 93 ------------ .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0102/hello-amd64.sh | 96 ------------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0103/hello-amd64.sh | 78 ----------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0104/hello-amd64.sh | 83 ----------- .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0105/hello-amd64.sh | 89 ------------ .../{hello-aarch64.sh => run_test.sh} | 2 +- test/test0106/hello-amd64.sh | 75 ---------- .../{hello-aarch64.sh => run_test.sh} | 2 +- 67 files changed, 99 insertions(+), 2479 deletions(-) delete mode 100755 test/test0000/hello-amd64.sh rename test/test0000/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0001/hello-amd64.sh rename test/test0001/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0002/hello-amd64.sh rename test/test0002/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0003/hello-amd64.sh rename test/test0003/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0004/hello-amd64.sh rename test/test0004/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0005/hello-amd64.sh rename test/test0005/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0006/hello-amd64.sh rename test/test0006/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0007/hello-amd64.sh rename test/test0007/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0008/hello-amd64.sh rename test/test0008/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0009/hello-amd64.sh rename test/test0009/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0010/hello-amd64.sh rename test/test0010/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0011/hello-amd64.sh rename test/test0011/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0012/hello-amd64.sh rename test/test0012/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0013/hello-amd64.sh rename test/test0013/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0014/hello-amd64.sh rename test/test0014/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0015/hello-amd64.sh rename test/test0015/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0016/hello-amd64.sh rename test/test0016/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0017/hello-amd64.sh rename test/test0017/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0018/hello-amd64.sh rename test/test0018/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0019/hello-amd64.sh rename test/test0019/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0020/hello-amd64.sh rename test/test0020/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0021/hello-aarch64.sh rename test/test0021/{hello-amd64.sh => run_test.sh} (99%) delete mode 100755 test/test0022/hello-aarch64.sh rename test/test0022/{hello-amd64.sh => run_test.sh} (99%) delete mode 100755 test/test0023/hello-aarch64.sh rename test/test0023/{hello-amd64.sh => run_test.sh} (99%) delete mode 100755 test/test0024/hello-amd64.sh rename test/test0024/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0025/hello-amd64.sh rename test/test0025/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0100/hello-amd64.sh rename test/test0100/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0101/hello-amd64.sh rename test/test0101/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0102/hello-amd64.sh rename test/test0102/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0103/hello-amd64.sh rename test/test0103/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0104/hello-amd64.sh rename test/test0104/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0105/hello-amd64.sh rename test/test0105/{hello-aarch64.sh => run_test.sh} (99%) delete mode 100755 test/test0106/hello-amd64.sh rename test/test0106/{hello-aarch64.sh => run_test.sh} (99%) diff --git a/makefile-tests b/makefile-tests index 2494242..fc07677 100644 --- a/makefile-tests +++ b/makefile-tests @@ -222,205 +222,205 @@ x86-tests: \ test1000-x86-binary | results test0000-aarch64-binary: M2-Planet | results - test/test0000/hello-aarch64.sh + test/test0000/run_test.sh aarch64 test0001-aarch64-binary: M2-Planet | results - test/test0001/hello-aarch64.sh + test/test0001/run_test.sh aarch64 test0002-aarch64-binary: M2-Planet | results - test/test0002/hello-aarch64.sh + test/test0002/run_test.sh aarch64 test0003-aarch64-binary: M2-Planet | results - test/test0003/hello-aarch64.sh + test/test0003/run_test.sh aarch64 test0004-aarch64-binary: M2-Planet | results - test/test0004/hello-aarch64.sh + test/test0004/run_test.sh aarch64 test0005-aarch64-binary: M2-Planet | results - test/test0005/hello-aarch64.sh + test/test0005/run_test.sh aarch64 test0006-aarch64-binary: M2-Planet | results - test/test0006/hello-aarch64.sh + test/test0006/run_test.sh aarch64 test0007-aarch64-binary: M2-Planet | results - test/test0007/hello-aarch64.sh + test/test0007/run_test.sh aarch64 test0008-aarch64-binary: M2-Planet | results - test/test0008/hello-aarch64.sh + test/test0008/run_test.sh aarch64 test0009-aarch64-binary: M2-Planet | results - test/test0009/hello-aarch64.sh + test/test0009/run_test.sh aarch64 test0010-aarch64-binary: M2-Planet | results - test/test0010/hello-aarch64.sh + test/test0010/run_test.sh aarch64 test0011-aarch64-binary: M2-Planet | results - test/test0011/hello-aarch64.sh + test/test0011/run_test.sh aarch64 test0012-aarch64-binary: M2-Planet | results - test/test0012/hello-aarch64.sh + test/test0012/run_test.sh aarch64 test0013-aarch64-binary: M2-Planet | results - test/test0013/hello-aarch64.sh + test/test0013/run_test.sh aarch64 test0014-aarch64-binary: M2-Planet | results - test/test0014/hello-aarch64.sh + test/test0014/run_test.sh aarch64 test0015-aarch64-binary: M2-Planet | results - test/test0015/hello-aarch64.sh + test/test0015/run_test.sh aarch64 test0016-aarch64-binary: M2-Planet | results - test/test0016/hello-aarch64.sh + test/test0016/run_test.sh aarch64 test0017-aarch64-binary: M2-Planet | results - test/test0017/hello-aarch64.sh + test/test0017/run_test.sh aarch64 test0018-aarch64-binary: M2-Planet | results - test/test0018/hello-aarch64.sh + test/test0018/run_test.sh aarch64 test0019-aarch64-binary: M2-Planet | results - test/test0019/hello-aarch64.sh + test/test0019/run_test.sh aarch64 test0020-aarch64-binary: M2-Planet | results - test/test0020/hello-aarch64.sh + test/test0020/run_test.sh aarch64 test0021-aarch64-binary: M2-Planet | results - test/test0021/hello-aarch64.sh + test/test0021/run_test.sh aarch64 test0022-aarch64-binary: M2-Planet | results - test/test0022/hello-aarch64.sh + test/test0022/run_test.sh aarch64 test0023-aarch64-binary: M2-Planet | results - test/test0023/hello-aarch64.sh + test/test0023/run_test.sh aarch64 test0024-aarch64-binary: M2-Planet | results - test/test0024/hello-aarch64.sh + test/test0024/run_test.sh aarch64 test0025-aarch64-binary: M2-Planet | results - test/test0025/hello-aarch64.sh + test/test0025/run_test.sh aarch64 test0100-aarch64-binary: M2-Planet | results - test/test0100/hello-aarch64.sh + test/test0100/run_test.sh aarch64 test0101-aarch64-binary: M2-Planet | results - test/test0101/hello-aarch64.sh + test/test0101/run_test.sh aarch64 test0102-aarch64-binary: M2-Planet | results - test/test0102/hello-aarch64.sh + test/test0102/run_test.sh aarch64 test0103-aarch64-binary: M2-Planet | results - test/test0103/hello-aarch64.sh + test/test0103/run_test.sh aarch64 test0104-aarch64-binary: M2-Planet | results - test/test0104/hello-aarch64.sh + test/test0104/run_test.sh aarch64 test0105-aarch64-binary: M2-Planet | results - test/test0105/hello-aarch64.sh + test/test0105/run_test.sh aarch64 test0106-aarch64-binary: M2-Planet | results - test/test0106/hello-aarch64.sh + test/test0106/run_test.sh aarch64 test1000-aarch64-binary: M2-Planet | results test/test1000/hello-aarch64.sh test0000-amd64-binary: M2-Planet | results - test/test0000/hello-amd64.sh + test/test0000/run_test.sh amd64 test0001-amd64-binary: M2-Planet | results - test/test0001/hello-amd64.sh + test/test0001/run_test.sh amd64 test0002-amd64-binary: M2-Planet | results - test/test0002/hello-amd64.sh + test/test0002/run_test.sh amd64 test0003-amd64-binary: M2-Planet | results - test/test0003/hello-amd64.sh + test/test0003/run_test.sh amd64 test0004-amd64-binary: M2-Planet | results - test/test0004/hello-amd64.sh + test/test0004/run_test.sh amd64 test0005-amd64-binary: M2-Planet | results - test/test0005/hello-amd64.sh + test/test0005/run_test.sh amd64 test0006-amd64-binary: M2-Planet | results - test/test0006/hello-amd64.sh + test/test0006/run_test.sh amd64 test0007-amd64-binary: M2-Planet | results - test/test0007/hello-amd64.sh + test/test0007/run_test.sh amd64 test0008-amd64-binary: M2-Planet | results - test/test0008/hello-amd64.sh + test/test0008/run_test.sh amd64 test0009-amd64-binary: M2-Planet | results - test/test0009/hello-amd64.sh + test/test0009/run_test.sh amd64 test0010-amd64-binary: M2-Planet | results - test/test0010/hello-amd64.sh + test/test0010/run_test.sh amd64 test0011-amd64-binary: M2-Planet | results - test/test0011/hello-amd64.sh + test/test0011/run_test.sh amd64 test0012-amd64-binary: M2-Planet | results - test/test0012/hello-amd64.sh + test/test0012/run_test.sh amd64 test0013-amd64-binary: M2-Planet | results - test/test0013/hello-amd64.sh + test/test0013/run_test.sh amd64 test0014-amd64-binary: M2-Planet | results - test/test0014/hello-amd64.sh + test/test0014/run_test.sh amd64 test0015-amd64-binary: M2-Planet | results - test/test0015/hello-amd64.sh + test/test0015/run_test.sh amd64 test0016-amd64-binary: M2-Planet | results - test/test0016/hello-amd64.sh + test/test0016/run_test.sh amd64 test0017-amd64-binary: M2-Planet | results - test/test0017/hello-amd64.sh + test/test0017/run_test.sh amd64 test0018-amd64-binary: M2-Planet | results - test/test0018/hello-amd64.sh + test/test0018/run_test.sh amd64 test0019-amd64-binary: M2-Planet | results - test/test0019/hello-amd64.sh + test/test0019/run_test.sh amd64 test0020-amd64-binary: M2-Planet | results - test/test0020/hello-amd64.sh + test/test0020/run_test.sh amd64 test0021-amd64-binary: M2-Planet | results - test/test0021/hello-amd64.sh + test/test0021/run_test.sh amd64 test0022-amd64-binary: M2-Planet | results - test/test0022/hello-amd64.sh + test/test0022/run_test.sh amd64 test0023-amd64-binary: M2-Planet | results - test/test0023/hello-amd64.sh + test/test0023/run_test.sh amd64 test0024-amd64-binary: M2-Planet | results - test/test0024/hello-amd64.sh + test/test0024/run_test.sh amd64 test0025-amd64-binary: M2-Planet | results - test/test0025/hello-amd64.sh + test/test0025/run_test.sh amd64 test0100-amd64-binary: M2-Planet | results - test/test0100/hello-amd64.sh + test/test0100/run_test.sh amd64 test0101-amd64-binary: M2-Planet | results - test/test0101/hello-amd64.sh + test/test0101/run_test.sh amd64 test0102-amd64-binary: M2-Planet | results - test/test0102/hello-amd64.sh + test/test0102/run_test.sh amd64 test0103-amd64-binary: M2-Planet | results - test/test0103/hello-amd64.sh + test/test0103/run_test.sh amd64 test0104-amd64-binary: M2-Planet | results - test/test0104/hello-amd64.sh + test/test0104/run_test.sh amd64 test0105-amd64-binary: M2-Planet | results - test/test0105/hello-amd64.sh + test/test0105/run_test.sh amd64 test0106-amd64-binary: M2-Planet | results - test/test0106/hello-amd64.sh + test/test0106/run_test.sh amd64 test1000-amd64-binary: M2-Planet | results test/test1000/hello-amd64.sh diff --git a/test/test0000/hello-amd64.sh b/test/test0000/hello-amd64.sh deleted file mode 100755 index fdce59f..0000000 --- a/test/test0000/hello-amd64.sh +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0000/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f test/test0000/return.c \ - -o ${TMPDIR}/return.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-core.M1 \ - -f ${TMPDIR}/return.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/return.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/return.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0000-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - ./test/results/test0000-${ARCH}-binary - [ 42 = $? ] || exit 3 -fi -exit 0 diff --git a/test/test0000/hello-aarch64.sh b/test/test0000/run_test.sh similarity index 99% rename from test/test0000/hello-aarch64.sh rename to test/test0000/run_test.sh index db5c220..477221f 100755 --- a/test/test0000/hello-aarch64.sh +++ b/test/test0000/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0000/tmp-${ARCH}" diff --git a/test/test0001/hello-amd64.sh b/test/test0001/hello-amd64.sh deleted file mode 100755 index 11a5e9c..0000000 --- a/test/test0001/hello-amd64.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0001/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0001/library_call.c \ - -o ${TMPDIR}/library_call.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/library_call.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/library_call.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/library_call.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0001-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0001-${ARCH}-binary 2>&1) - [ 42 = $? ] || exit 3 - [ "$out" = "Hello mes" ] || exit 4 -fi -exit 0 diff --git a/test/test0001/hello-aarch64.sh b/test/test0001/run_test.sh similarity index 99% rename from test/test0001/hello-aarch64.sh rename to test/test0001/run_test.sh index 5f5de74..b84b19a 100755 --- a/test/test0001/hello-aarch64.sh +++ b/test/test0001/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0001/tmp-${ARCH}" diff --git a/test/test0002/hello-amd64.sh b/test/test0002/hello-amd64.sh deleted file mode 100755 index 93f361d..0000000 --- a/test/test0002/hello-amd64.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0002/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0002/if.c \ - -o ${TMPDIR}/if.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/if.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/if.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/if.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0002-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0002-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0002/hello-aarch64.sh b/test/test0002/run_test.sh similarity index 99% rename from test/test0002/hello-aarch64.sh rename to test/test0002/run_test.sh index c856ead..eb2aac1 100755 --- a/test/test0002/hello-aarch64.sh +++ b/test/test0002/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0002/tmp-${ARCH}" diff --git a/test/test0003/hello-amd64.sh b/test/test0003/hello-amd64.sh deleted file mode 100755 index 9cdcbb4..0000000 --- a/test/test0003/hello-amd64.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0003/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0003/constant.c \ - -o ${TMPDIR}/constant.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/constant.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/constant.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/constant.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0003-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0003-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0003/hello-aarch64.sh b/test/test0003/run_test.sh similarity index 99% rename from test/test0003/hello-aarch64.sh rename to test/test0003/run_test.sh index db56d12..145b669 100755 --- a/test/test0003/hello-aarch64.sh +++ b/test/test0003/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0003/tmp-${ARCH}" diff --git a/test/test0004/hello-amd64.sh b/test/test0004/hello-amd64.sh deleted file mode 100755 index 8ff5d7f..0000000 --- a/test/test0004/hello-amd64.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0004/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0004/call.c \ - -o ${TMPDIR}/call.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/call.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/call.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/call.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0004-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0004-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0004/hello-aarch64.sh b/test/test0004/run_test.sh similarity index 99% rename from test/test0004/hello-aarch64.sh rename to test/test0004/run_test.sh index d1cf360..cdc0d66 100755 --- a/test/test0004/hello-aarch64.sh +++ b/test/test0004/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0004/tmp-${ARCH}" diff --git a/test/test0005/hello-amd64.sh b/test/test0005/hello-amd64.sh deleted file mode 100755 index 774cf72..0000000 --- a/test/test0005/hello-amd64.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0005/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0005/string.c \ - -o ${TMPDIR}/string.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/string.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/string.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/string.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0005-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0005-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0005/hello-aarch64.sh b/test/test0005/run_test.sh similarity index 99% rename from test/test0005/hello-aarch64.sh rename to test/test0005/run_test.sh index 7b6e651..399f15d 100755 --- a/test/test0005/hello-aarch64.sh +++ b/test/test0005/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0005/tmp-${ARCH}" diff --git a/test/test0006/hello-amd64.sh b/test/test0006/hello-amd64.sh deleted file mode 100755 index 3c4da79..0000000 --- a/test/test0006/hello-amd64.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0006/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0006/for.c \ - -o ${TMPDIR}/for.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/for.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/for.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/for.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0006-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0006/hello-aarch64.sh b/test/test0006/run_test.sh similarity index 99% rename from test/test0006/hello-aarch64.sh rename to test/test0006/run_test.sh index 5cddd8a..498ba04 100755 --- a/test/test0006/hello-aarch64.sh +++ b/test/test0006/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0006/tmp-${ARCH}" diff --git a/test/test0007/hello-amd64.sh b/test/test0007/hello-amd64.sh deleted file mode 100755 index ba27958..0000000 --- a/test/test0007/hello-amd64.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0007/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0007/do.c \ - -o ${TMPDIR}/do.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/do.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/do.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/do.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0007-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0007/hello-aarch64.sh b/test/test0007/run_test.sh similarity index 99% rename from test/test0007/hello-aarch64.sh rename to test/test0007/run_test.sh index fb3b7c2..17c6f20 100755 --- a/test/test0007/hello-aarch64.sh +++ b/test/test0007/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0007/tmp-${ARCH}" diff --git a/test/test0008/hello-amd64.sh b/test/test0008/hello-amd64.sh deleted file mode 100755 index 5a63eab..0000000 --- a/test/test0008/hello-amd64.sh +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0008/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0008/struct.c \ - --debug \ - -o ${TMPDIR}/struct.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/struct.M1 \ - --entry _start \ - -o ${TMPDIR}/struct-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/struct.M1 \ - -f ${TMPDIR}/struct-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/struct.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/struct.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0008-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0008-${ARCH}-binary 2>&1 ) - [ 32 = $? ] || exit 4 - [ "$out" = "35419896642975313541989657891634" ] || exit 5 -fi -exit 0 diff --git a/test/test0008/hello-aarch64.sh b/test/test0008/run_test.sh similarity index 99% rename from test/test0008/hello-aarch64.sh rename to test/test0008/run_test.sh index d493341..8d050b9 100755 --- a/test/test0008/hello-aarch64.sh +++ b/test/test0008/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0008/tmp-${ARCH}" diff --git a/test/test0009/hello-amd64.sh b/test/test0009/hello-amd64.sh deleted file mode 100755 index 9f51526..0000000 --- a/test/test0009/hello-amd64.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0009/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0009/goto.c \ - -o ${TMPDIR}/goto.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/goto.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/goto.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/goto.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0009-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0009-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0009/hello-aarch64.sh b/test/test0009/run_test.sh similarity index 99% rename from test/test0009/hello-aarch64.sh rename to test/test0009/run_test.sh index d71bd6e..b8854de 100755 --- a/test/test0009/hello-aarch64.sh +++ b/test/test0009/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0009/tmp-${ARCH}" diff --git a/test/test0010/hello-amd64.sh b/test/test0010/hello-amd64.sh deleted file mode 100755 index b7c4e34..0000000 --- a/test/test0010/hello-amd64.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0010/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0010/nested_struct.c \ - -o ${TMPDIR}/nested_struct.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/nested_struct.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/nested_struct.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/nested_struct.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0010-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0010-${ARCH}-binary 2>&1 ) - [ 24 = $? ] || exit 4 - [ "$out" = "35419896642975313541989657891634" ] || exit 5 -fi -exit 0 diff --git a/test/test0010/hello-aarch64.sh b/test/test0010/run_test.sh similarity index 99% rename from test/test0010/hello-aarch64.sh rename to test/test0010/run_test.sh index a2c0bbe..1e66d6f 100755 --- a/test/test0010/hello-aarch64.sh +++ b/test/test0010/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0010/tmp-${ARCH}" diff --git a/test/test0011/hello-amd64.sh b/test/test0011/hello-amd64.sh deleted file mode 100755 index 1f4579d..0000000 --- a/test/test0011/hello-amd64.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0011/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0011/break-do.c \ - -o ${TMPDIR}/break-do.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/break-do.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/break-do.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/break-do.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0011-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0011/hello-aarch64.sh b/test/test0011/run_test.sh similarity index 99% rename from test/test0011/hello-aarch64.sh rename to test/test0011/run_test.sh index bc26261..842261b 100755 --- a/test/test0011/hello-aarch64.sh +++ b/test/test0011/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0011/tmp-${ARCH}" diff --git a/test/test0012/hello-amd64.sh b/test/test0012/hello-amd64.sh deleted file mode 100755 index 0926b8d..0000000 --- a/test/test0012/hello-amd64.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0012/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0012/break-for.c \ - -o ${TMPDIR}/break-for.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/break-for.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/break-for.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/break-for.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0012-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0012/hello-aarch64.sh b/test/test0012/run_test.sh similarity index 99% rename from test/test0012/hello-aarch64.sh rename to test/test0012/run_test.sh index cbbf7ca..e34aa31 100755 --- a/test/test0012/hello-aarch64.sh +++ b/test/test0012/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0012/tmp-${ARCH}" diff --git a/test/test0013/hello-amd64.sh b/test/test0013/hello-amd64.sh deleted file mode 100755 index 68961fb..0000000 --- a/test/test0013/hello-amd64.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0013/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0013/break-while.c \ - -o ${TMPDIR}/break-while.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/break-while.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/break-while.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/break-while.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0013-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0013/hello-aarch64.sh b/test/test0013/run_test.sh similarity index 99% rename from test/test0013/hello-aarch64.sh rename to test/test0013/run_test.sh index e16336a..aab90cf 100755 --- a/test/test0013/hello-aarch64.sh +++ b/test/test0013/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0013/tmp-${ARCH}" diff --git a/test/test0014/hello-amd64.sh b/test/test0014/hello-amd64.sh deleted file mode 100755 index fdfc070..0000000 --- a/test/test0014/hello-amd64.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0014/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0014/basic_args.c \ - -o ${TMPDIR}/basic_args.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/basic_args.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/basic_args.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/basic_args.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0014-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 diff --git a/test/test0014/hello-aarch64.sh b/test/test0014/run_test.sh similarity index 99% rename from test/test0014/hello-aarch64.sh rename to test/test0014/run_test.sh index 20212f9..052242e 100755 --- a/test/test0014/hello-aarch64.sh +++ b/test/test0014/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0014/tmp-${ARCH}" diff --git a/test/test0015/hello-amd64.sh b/test/test0015/hello-amd64.sh deleted file mode 100755 index c912d39..0000000 --- a/test/test0015/hello-amd64.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0015/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0015/file_read.c \ - -o ${TMPDIR}/file_read.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/file_read.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/file_read.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/file_read.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0015-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0015/hello-aarch64.sh b/test/test0015/run_test.sh similarity index 99% rename from test/test0015/hello-aarch64.sh rename to test/test0015/run_test.sh index 982add3..b77c7d3 100755 --- a/test/test0015/hello-aarch64.sh +++ b/test/test0015/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0015/tmp-${ARCH}" diff --git a/test/test0016/hello-amd64.sh b/test/test0016/hello-amd64.sh deleted file mode 100755 index 7d1f617..0000000 --- a/test/test0016/hello-amd64.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0016/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0016/file_write.c \ - -o ${TMPDIR}/file_write.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/file_write.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/file_write.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/file_write.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0016-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0016/hello-aarch64.sh b/test/test0016/run_test.sh similarity index 99% rename from test/test0016/hello-aarch64.sh rename to test/test0016/run_test.sh index 3fb68ed..54986a1 100755 --- a/test/test0016/hello-aarch64.sh +++ b/test/test0016/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0016/tmp-${ARCH}" diff --git a/test/test0017/hello-amd64.sh b/test/test0017/hello-amd64.sh deleted file mode 100755 index 4a04fa1..0000000 --- a/test/test0017/hello-amd64.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0017/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0017/memset.c \ - -o ${TMPDIR}/memset.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/memset.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/memset.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/memset.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0017-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0017/hello-aarch64.sh b/test/test0017/run_test.sh similarity index 99% rename from test/test0017/hello-aarch64.sh rename to test/test0017/run_test.sh index a8a800d..712a545 100755 --- a/test/test0017/hello-aarch64.sh +++ b/test/test0017/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0017/tmp-${ARCH}" diff --git a/test/test0018/hello-amd64.sh b/test/test0018/hello-amd64.sh deleted file mode 100755 index 1a3603f..0000000 --- a/test/test0018/hello-amd64.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0018/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0018/math.c \ - -o ${TMPDIR}/math.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/math.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/math.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/math.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0018-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0018/hello-aarch64.sh b/test/test0018/run_test.sh similarity index 99% rename from test/test0018/hello-aarch64.sh rename to test/test0018/run_test.sh index 6aed276..a18bfcf 100755 --- a/test/test0018/hello-aarch64.sh +++ b/test/test0018/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0018/tmp-${ARCH}" diff --git a/test/test0019/hello-amd64.sh b/test/test0019/hello-amd64.sh deleted file mode 100755 index f84a032..0000000 --- a/test/test0019/hello-amd64.sh +++ /dev/null @@ -1,71 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0019/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/file_print.c \ - -f test/test0019/getopt.c \ - -o ${TMPDIR}/getopt.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/getopt.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/getopt.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/getopt.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0019-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0019/hello-aarch64.sh b/test/test0019/run_test.sh similarity index 99% rename from test/test0019/hello-aarch64.sh rename to test/test0019/run_test.sh index 26dc1f7..de6dabe 100755 --- a/test/test0019/hello-aarch64.sh +++ b/test/test0019/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0019/tmp-${ARCH}" diff --git a/test/test0020/hello-amd64.sh b/test/test0020/hello-amd64.sh deleted file mode 100755 index e70dfb7..0000000 --- a/test/test0020/hello-amd64.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0020/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0020/struct.c \ - -o ${TMPDIR}/struct.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/struct.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/struct.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/struct.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0020-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0020-${ARCH}-binary 2>&1 ) - [ 40 = $? ] || exit 4 - [ "$out" = "35419896642975313541989657891634" ] || exit 5 -fi -exit 0 diff --git a/test/test0020/hello-aarch64.sh b/test/test0020/run_test.sh similarity index 99% rename from test/test0020/hello-aarch64.sh rename to test/test0020/run_test.sh index 91f9bae..074e773 100755 --- a/test/test0020/hello-aarch64.sh +++ b/test/test0020/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0020/tmp-${ARCH}" diff --git a/test/test0021/hello-aarch64.sh b/test/test0021/hello-aarch64.sh deleted file mode 100755 index 5f21515..0000000 --- a/test/test0021/hello-aarch64.sh +++ /dev/null @@ -1,78 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="aarch64" -. test/env.inc.sh -TMPDIR="test/test0021/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/match.c \ - -f functions/file_print.c \ - -f test/test0021/chdir.c \ - --debug \ - -o ${TMPDIR}/chdir.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/chdir.M1 \ - --entry _start \ - -o ${TMPDIR}/chdir-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/chdir.M1 \ - -f ${TMPDIR}/chdir-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/chdir.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/chdir.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0021-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0021-${ARCH}-binary - [ 0 = $? ] || exit 5 -fi -exit 0 diff --git a/test/test0021/hello-amd64.sh b/test/test0021/run_test.sh similarity index 99% rename from test/test0021/hello-amd64.sh rename to test/test0021/run_test.sh index 8ae9506..c03bd06 100755 --- a/test/test0021/hello-amd64.sh +++ b/test/test0021/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="amd64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0021/tmp-${ARCH}" diff --git a/test/test0022/hello-aarch64.sh b/test/test0022/hello-aarch64.sh deleted file mode 100755 index 15705c0..0000000 --- a/test/test0022/hello-aarch64.sh +++ /dev/null @@ -1,81 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="aarch64" -. test/env.inc.sh -TMPDIR="test/test0022/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/file_print.c \ - -f test/test0022/continue.c \ - --debug \ - -o ${TMPDIR}/continue.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/continue.M1 \ - --entry _start \ - -o ${TMPDIR}/continue-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/continue.M1 \ - -f ${TMPDIR}/continue-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/continue.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/continue.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0022-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -fi -exit 0 diff --git a/test/test0022/hello-amd64.sh b/test/test0022/run_test.sh similarity index 99% rename from test/test0022/hello-amd64.sh rename to test/test0022/run_test.sh index 04e786f..6a481a4 100755 --- a/test/test0022/hello-amd64.sh +++ b/test/test0022/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="amd64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0022/tmp-${ARCH}" diff --git a/test/test0023/hello-aarch64.sh b/test/test0023/hello-aarch64.sh deleted file mode 100755 index b238250..0000000 --- a/test/test0023/hello-aarch64.sh +++ /dev/null @@ -1,78 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="aarch64" -. test/env.inc.sh -TMPDIR="test/test0023/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0023/fseek.c \ - --debug \ - -o ${TMPDIR}/fseek.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/fseek.M1 \ - --entry _start \ - -o ${TMPDIR}/fseek-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/fseek.M1 \ - -f ${TMPDIR}/fseek-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/fseek.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/fseek.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0023-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -fi -exit 0 diff --git a/test/test0023/hello-amd64.sh b/test/test0023/run_test.sh similarity index 99% rename from test/test0023/hello-amd64.sh rename to test/test0023/run_test.sh index c20b937..ec8be4f 100755 --- a/test/test0023/hello-amd64.sh +++ b/test/test0023/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="amd64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0023/tmp-${ARCH}" diff --git a/test/test0024/hello-amd64.sh b/test/test0024/hello-amd64.sh deleted file mode 100755 index eb5d975..0000000 --- a/test/test0024/hello-amd64.sh +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0024/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f test/test0024/return.c \ - -o ${TMPDIR}/return.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-core.M1 \ - -f ${TMPDIR}/return.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/return.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/return.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0024-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - ./test/results/test0024-${ARCH}-binary - [ 42 = $? ] || exit 3 -fi -exit 0 diff --git a/test/test0024/hello-aarch64.sh b/test/test0024/run_test.sh similarity index 99% rename from test/test0024/hello-aarch64.sh rename to test/test0024/run_test.sh index 013faf8..7567113 100755 --- a/test/test0024/hello-aarch64.sh +++ b/test/test0024/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0024/tmp-${ARCH}" diff --git a/test/test0025/hello-amd64.sh b/test/test0025/hello-amd64.sh deleted file mode 100755 index 147f342..0000000 --- a/test/test0025/hello-amd64.sh +++ /dev/null @@ -1,77 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0025/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0025/array.c \ - --debug \ - -o ${TMPDIR}/array.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/array.M1 \ - --entry _start \ - -o ${TMPDIR}/array-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/array.M1 \ - -f ${TMPDIR}/array-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/array.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/array.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0025-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0025-${ARCH}-binary 2>| test/test0025/proof || exit 4 - out=$(sha256_check test/test0025/proof.answer) - [ "$out" = "test/test0025/proof: OK" ] || exit 5 -fi -exit 0 diff --git a/test/test0025/hello-aarch64.sh b/test/test0025/run_test.sh similarity index 99% rename from test/test0025/hello-aarch64.sh rename to test/test0025/run_test.sh index dbea8e5..09e4614 100755 --- a/test/test0025/hello-aarch64.sh +++ b/test/test0025/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0025/tmp-${ARCH}" diff --git a/test/test0100/hello-amd64.sh b/test/test0100/hello-amd64.sh deleted file mode 100755 index ea14fff..0000000 --- a/test/test0100/hello-amd64.sh +++ /dev/null @@ -1,85 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0100/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f test/test0100/blood-elf.c \ - --debug \ - -o ${TMPDIR}/blood-elf.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/blood-elf.M1 \ - --entry _start \ - -o ${TMPDIR}/blood-elf-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/blood-elf.M1 \ - -f ${TMPDIR}/blood-elf-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/blood-elf.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/blood-elf.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0100-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0100-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "blood-elf 0.1 -(Basically Launches Odd Object Dump ExecutabLe Files" ] || exit 6 - - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0100-${ARCH}-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 - out=$(sha256_check test/test0100/proof.answer) - [ "$out" = "test/test0100/proof: OK" ] || exit 8 -fi -exit 0 diff --git a/test/test0100/hello-aarch64.sh b/test/test0100/run_test.sh similarity index 99% rename from test/test0100/hello-aarch64.sh rename to test/test0100/run_test.sh index 190ef03..c45faaf 100755 --- a/test/test0100/hello-aarch64.sh +++ b/test/test0100/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0100/tmp-${ARCH}" diff --git a/test/test0101/hello-amd64.sh b/test/test0101/hello-amd64.sh deleted file mode 100755 index 2ec4cc8..0000000 --- a/test/test0101/hello-amd64.sh +++ /dev/null @@ -1,93 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0101/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f test/test0101/hex2_linker.c \ - --debug \ - -o ${TMPDIR}/hex2_linker.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/hex2_linker.M1 \ - --entry _start \ - -o ${TMPDIR}/hex2_linker-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/hex2_linker.M1 \ - -f ${TMPDIR}/hex2_linker-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/hex2_linker.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/hex2_linker.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0101-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0101-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "hex2 0.3" ] || exit 6 - - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0101-${ARCH}-binary \ - -f M2libc/x86/ELF-x86.hex2 \ - -f test/test0101/test.hex2 \ - --LittleEndian \ - --architecture x86 \ - --BaseAddress 0x8048000 \ - -o test/test0101/proof \ - || exit 7 - out=$(sha256_check test/test0101/proof.answer) - [ "$out" = "test/test0101/proof: OK" ] || exit 8 -fi -exit 0 diff --git a/test/test0101/hello-aarch64.sh b/test/test0101/run_test.sh similarity index 99% rename from test/test0101/hello-aarch64.sh rename to test/test0101/run_test.sh index 48bfc78..b8be868 100755 --- a/test/test0101/hello-aarch64.sh +++ b/test/test0101/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0101/tmp-${ARCH}" diff --git a/test/test0102/hello-amd64.sh b/test/test0102/hello-amd64.sh deleted file mode 100755 index 5b6afa3..0000000 --- a/test/test0102/hello-amd64.sh +++ /dev/null @@ -1,96 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0102/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/string.c \ - -f functions/require.c \ - -f test/test0102/M1-macro.c \ - --debug \ - -o ${TMPDIR}/M1-macro.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/M1-macro.M1 \ - --entry _start \ - -o ${TMPDIR}/M1-macro-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/M1-macro.M1 \ - -f ${TMPDIR}/M1-macro-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/M1-macro.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/M1-macro.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0102-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0102-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "M1 1.0.0" ] || exit 6 - - # Verify that the resulting file works - ./test/results/test0102-${ARCH}-binary \ - -f M2libc/x86/x86_defs.M1 \ - -f M2libc/x86/libc-core.M1 \ - -f test/test0100/test.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture x86 \ - -o test/test0102/proof \ - || exit 7 - - . ./sha256.sh - out=$(sha256_check test/test0102/proof.answer) - [ "$out" = "test/test0102/proof: OK" ] || exit 8 -fi -exit 0 diff --git a/test/test0102/hello-aarch64.sh b/test/test0102/run_test.sh similarity index 99% rename from test/test0102/hello-aarch64.sh rename to test/test0102/run_test.sh index c2513c0..e6deec4 100755 --- a/test/test0102/hello-aarch64.sh +++ b/test/test0102/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0102/tmp-${ARCH}" diff --git a/test/test0103/hello-amd64.sh b/test/test0103/hello-amd64.sh deleted file mode 100755 index 1c21cc3..0000000 --- a/test/test0103/hello-amd64.sh +++ /dev/null @@ -1,78 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0103/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f test/test0103/get_machine.c \ - --debug \ - -o ${TMPDIR}/get_machine.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/get_machine.M1 \ - --entry _start \ - -o ${TMPDIR}/get_machine-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/get_machine.M1 \ - -f ${TMPDIR}/get_machine-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/get_machine.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/get_machine.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0103-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0103-${ARCH}-binary ${GET_MACHINE_FLAGS} 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "${ARCH}" ] || exit 6 -fi -exit 0 diff --git a/test/test0103/hello-aarch64.sh b/test/test0103/run_test.sh similarity index 99% rename from test/test0103/hello-aarch64.sh rename to test/test0103/run_test.sh index e2b0eb6..0b78b05 100755 --- a/test/test0103/hello-aarch64.sh +++ b/test/test0103/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0103/tmp-${ARCH}" diff --git a/test/test0104/hello-amd64.sh b/test/test0104/hello-amd64.sh deleted file mode 100755 index 603fc68..0000000 --- a/test/test0104/hello-amd64.sh +++ /dev/null @@ -1,83 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0104/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f test/test0104/kaem.c \ - --debug \ - -o ${TMPDIR}/kaem.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/kaem.M1 \ - --entry _start \ - -o ${TMPDIR}/kaem-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/kaem.M1 \ - -f ${TMPDIR}/kaem-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/kaem.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/kaem.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0104-${ARCH}-binary \ - || exit 4 - -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0104-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "kaem version 0.6.0" ] || exit 6 - - # Verify that the resulting file works - out=$(./test/results/test0104-${ARCH}-binary --file test/test0104/kaem.run) - [ "$out" = "hello world" ] || exit 7 -fi -exit 0 diff --git a/test/test0104/hello-aarch64.sh b/test/test0104/run_test.sh similarity index 99% rename from test/test0104/hello-aarch64.sh rename to test/test0104/run_test.sh index a03f847..c586c39 100755 --- a/test/test0104/hello-aarch64.sh +++ b/test/test0104/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0104/tmp-${ARCH}" diff --git a/test/test0105/hello-amd64.sh b/test/test0105/hello-amd64.sh deleted file mode 100755 index 2dbbbe3..0000000 --- a/test/test0105/hello-amd64.sh +++ /dev/null @@ -1,89 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0105/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0105/lisp.h \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/match.c \ - -f functions/file_print.c \ - -f test/test0105/lisp.c \ - -f test/test0105/lisp_cell.c \ - -f test/test0105/lisp_eval.c \ - -f test/test0105/lisp_print.c \ - -f test/test0105/lisp_read.c \ - --debug \ - -o ${TMPDIR}/lisp.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - --64 \ - -f ${TMPDIR}/lisp.M1 \ - --entry _start \ - -o ${TMPDIR}/lisp-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/lisp.M1 \ - -f ${TMPDIR}/lisp-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/lisp.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/lisp.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0105-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0105-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "Slow_Lisp 0.1" ] || exit 6 - - # Verify that the resulting file works - out=$(./test/results/test0105-${ARCH}-binary --file test/test0105/test.scm) - [ "$out" = "42" ] || exit 7 -fi -exit 0 diff --git a/test/test0105/hello-aarch64.sh b/test/test0105/run_test.sh similarity index 99% rename from test/test0105/hello-aarch64.sh rename to test/test0105/run_test.sh index 7c6a3c8..a5b9a0c 100755 --- a/test/test0105/hello-aarch64.sh +++ b/test/test0105/run_test.sh @@ -18,7 +18,7 @@ set -x -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0105/tmp-${ARCH}" diff --git a/test/test0106/hello-amd64.sh b/test/test0106/hello-amd64.sh deleted file mode 100755 index 46ec793..0000000 --- a/test/test0106/hello-amd64.sh +++ /dev/null @@ -1,75 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="amd64" -. test/env.inc.sh -TMPDIR="test/test0106/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0106/cc500.c \ - -o ${TMPDIR}/cc0.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/cc0.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/cc0.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/cc0.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0106-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the compiled program can compile itself - ./test/results/test0106-${ARCH}-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 - out=$(sha256_check test/test0106/proof0.answer) - [ "$out" = "test/test0106/cc1: OK" ] || exit 5 - - # Make it executable - chmod u+x test/test0106/cc1 - - # Verify that the result of it compiling itself can compile itself - ./test/test0106/cc1 < test/test0106/cc500.c >| test/test0106/cc2 || exit 6 - out=$(sha256_check test/test0106/proof1.answer) - [ "$out" = "test/test0106/cc2: OK" ] || exit 7 -fi -exit 0 diff --git a/test/test0106/hello-aarch64.sh b/test/test0106/run_test.sh similarity index 99% rename from test/test0106/hello-aarch64.sh rename to test/test0106/run_test.sh index 7fd303b..b4fc1e1 100755 --- a/test/test0106/hello-aarch64.sh +++ b/test/test0106/run_test.sh @@ -18,7 +18,7 @@ set -ex -ARCH="aarch64" +ARCH="$1" . test/env.inc.sh TMPDIR="test/test0106/tmp-${ARCH}" From 3400296b9b2c7cf606b03dd986033839209b1474 Mon Sep 17 00:00:00 2001 From: deesix Date: Sun, 31 Jan 2021 00:00:00 +0100 Subject: [PATCH 07/10] @@@ BLOOD_ELF_WORD_SIZE_FLAG --- test/env.inc.sh | 4 ++++ test/test0008/run_test.sh | 2 +- test/test0021/run_test.sh | 2 +- test/test0022/run_test.sh | 2 +- test/test0023/run_test.sh | 2 +- test/test0025/run_test.sh | 2 +- test/test0100/run_test.sh | 2 +- test/test0101/run_test.sh | 2 +- test/test0102/run_test.sh | 2 +- test/test0103/run_test.sh | 2 +- test/test0104/run_test.sh | 2 +- test/test0105/run_test.sh | 2 +- 12 files changed, 15 insertions(+), 11 deletions(-) diff --git a/test/env.inc.sh b/test/env.inc.sh index 94aff5c..d5a96ce 100644 --- a/test/env.inc.sh +++ b/test/env.inc.sh @@ -19,18 +19,22 @@ case "${ARCH}" in aarch64) BASE_ADDRESS="0x00400000" + BLOOD_ELF_WORD_SIZE_FLAG="--64" ENDIANNESS_FLAG="--little-endian" ;; amd64) BASE_ADDRESS="0x00600000" + BLOOD_ELF_WORD_SIZE_FLAG="--64" ENDIANNESS_FLAG="--little-endian" ;; armv7l) BASE_ADDRESS="0x00010000" + BLOOD_ELF_WORD_SIZE_FLAG="" ENDIANNESS_FLAG="--little-endian" ;; x86) BASE_ADDRESS="0x08048000" + BLOOD_ELF_WORD_SIZE_FLAG="" ENDIANNESS_FLAG="--little-endian" ;; *) diff --git a/test/test0008/run_test.sh b/test/test0008/run_test.sh index 8d050b9..87a82af 100755 --- a/test/test0008/run_test.sh +++ b/test/test0008/run_test.sh @@ -38,7 +38,7 @@ bin/M2-Planet \ # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/struct.M1 \ --entry _start \ -o ${TMPDIR}/struct-footer.M1 \ diff --git a/test/test0021/run_test.sh b/test/test0021/run_test.sh index c03bd06..53ef473 100755 --- a/test/test0021/run_test.sh +++ b/test/test0021/run_test.sh @@ -40,7 +40,7 @@ bin/M2-Planet \ # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/chdir.M1 \ --entry _start \ -o ${TMPDIR}/chdir-footer.M1 \ diff --git a/test/test0022/run_test.sh b/test/test0022/run_test.sh index 6a481a4..6f11731 100755 --- a/test/test0022/run_test.sh +++ b/test/test0022/run_test.sh @@ -41,7 +41,7 @@ bin/M2-Planet \ # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/continue.M1 \ --entry _start \ -o ${TMPDIR}/continue-footer.M1 \ diff --git a/test/test0023/run_test.sh b/test/test0023/run_test.sh index ec8be4f..62a3121 100755 --- a/test/test0023/run_test.sh +++ b/test/test0023/run_test.sh @@ -38,7 +38,7 @@ bin/M2-Planet \ # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/fseek.M1 \ --entry _start \ -o ${TMPDIR}/fseek-footer.M1 \ diff --git a/test/test0025/run_test.sh b/test/test0025/run_test.sh index 09e4614..5f97d09 100755 --- a/test/test0025/run_test.sh +++ b/test/test0025/run_test.sh @@ -38,7 +38,7 @@ bin/M2-Planet \ # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/array.M1 \ --entry _start \ -o ${TMPDIR}/array-footer.M1 \ diff --git a/test/test0100/run_test.sh b/test/test0100/run_test.sh index c45faaf..7386c56 100755 --- a/test/test0100/run_test.sh +++ b/test/test0100/run_test.sh @@ -40,7 +40,7 @@ mkdir -p ${TMPDIR} # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/blood-elf.M1 \ --entry _start \ -o ${TMPDIR}/blood-elf-footer.M1 \ diff --git a/test/test0101/run_test.sh b/test/test0101/run_test.sh index b8be868..3a09938 100755 --- a/test/test0101/run_test.sh +++ b/test/test0101/run_test.sh @@ -42,7 +42,7 @@ mkdir -p ${TMPDIR} # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/hex2_linker.M1 \ --entry _start \ -o ${TMPDIR}/hex2_linker-footer.M1 \ diff --git a/test/test0102/run_test.sh b/test/test0102/run_test.sh index e6deec4..a27199b 100755 --- a/test/test0102/run_test.sh +++ b/test/test0102/run_test.sh @@ -44,7 +44,7 @@ mkdir -p ${TMPDIR} # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/M1-macro.M1 \ --entry _start \ -o ${TMPDIR}/M1-macro-footer.M1 \ diff --git a/test/test0103/run_test.sh b/test/test0103/run_test.sh index 0b78b05..ee61c4a 100755 --- a/test/test0103/run_test.sh +++ b/test/test0103/run_test.sh @@ -40,7 +40,7 @@ mkdir -p ${TMPDIR} # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/get_machine.M1 \ --entry _start \ -o ${TMPDIR}/get_machine-footer.M1 \ diff --git a/test/test0104/run_test.sh b/test/test0104/run_test.sh index c586c39..7ab2367 100755 --- a/test/test0104/run_test.sh +++ b/test/test0104/run_test.sh @@ -42,7 +42,7 @@ mkdir -p ${TMPDIR} # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/kaem.M1 \ --entry _start \ -o ${TMPDIR}/kaem-footer.M1 \ diff --git a/test/test0105/run_test.sh b/test/test0105/run_test.sh index a5b9a0c..60dba5c 100755 --- a/test/test0105/run_test.sh +++ b/test/test0105/run_test.sh @@ -47,7 +47,7 @@ mkdir -p ${TMPDIR} # Build debug footer blood-elf \ - --64 \ + ${BLOOD_ELF_WORD_SIZE_FLAG} \ -f ${TMPDIR}/lisp.M1 \ --entry _start \ -o ${TMPDIR}/lisp-footer.M1 \ From dd67ccddce4d8155e4255f12606ea83b1f727106 Mon Sep 17 00:00:00 2001 From: deesix Date: Sun, 31 Jan 2021 00:00:00 +0100 Subject: [PATCH 08/10] @@@ ARCH_IS_64_BITS In three scripts, we need to adjust the expected value check depending on the word size of the arch. We do it based on a this new var. --- makefile-tests | 132 +++++++++++++++++++------------------- test/env.inc.sh | 4 ++ test/test0008/run_test.sh | 5 +- test/test0010/run_test.sh | 5 +- test/test0020/run_test.sh | 5 +- 5 files changed, 82 insertions(+), 69 deletions(-) diff --git a/makefile-tests b/makefile-tests index fc07677..67f711e 100644 --- a/makefile-tests +++ b/makefile-tests @@ -576,205 +576,205 @@ test0106-knight-native-binary: M2-Planet | results test/test0106/hello-knight-native.sh test0000-armv7l-binary: M2-Planet | results - test/test0000/hello-armv7l.sh + test/test0000/run_test.sh armv7l test0001-armv7l-binary: M2-Planet | results - test/test0001/hello-armv7l.sh + test/test0001/run_test.sh armv7l test0002-armv7l-binary: M2-Planet | results - test/test0002/hello-armv7l.sh + test/test0002/run_test.sh armv7l test0003-armv7l-binary: M2-Planet | results - test/test0003/hello-armv7l.sh + test/test0003/run_test.sh armv7l test0004-armv7l-binary: M2-Planet | results - test/test0004/hello-armv7l.sh + test/test0004/run_test.sh armv7l test0005-armv7l-binary: M2-Planet | results - test/test0005/hello-armv7l.sh + test/test0005/run_test.sh armv7l test0006-armv7l-binary: M2-Planet | results - test/test0006/hello-armv7l.sh + test/test0006/run_test.sh armv7l test0007-armv7l-binary: M2-Planet | results - test/test0007/hello-armv7l.sh + test/test0007/run_test.sh armv7l test0008-armv7l-binary: M2-Planet | results - test/test0008/hello-armv7l.sh + test/test0008/run_test.sh armv7l test0009-armv7l-binary: M2-Planet | results - test/test0009/hello-armv7l.sh + test/test0009/run_test.sh armv7l test0010-armv7l-binary: M2-Planet | results - test/test0010/hello-armv7l.sh + test/test0010/run_test.sh armv7l test0011-armv7l-binary: M2-Planet | results - test/test0011/hello-armv7l.sh + test/test0011/run_test.sh armv7l test0012-armv7l-binary: M2-Planet | results - test/test0012/hello-armv7l.sh + test/test0012/run_test.sh armv7l test0013-armv7l-binary: M2-Planet | results - test/test0013/hello-armv7l.sh + test/test0013/run_test.sh armv7l test0014-armv7l-binary: M2-Planet | results - test/test0014/hello-armv7l.sh + test/test0014/run_test.sh armv7l test0015-armv7l-binary: M2-Planet | results - test/test0015/hello-armv7l.sh + test/test0015/run_test.sh armv7l test0016-armv7l-binary: M2-Planet | results - test/test0016/hello-armv7l.sh + test/test0016/run_test.sh armv7l test0017-armv7l-binary: M2-Planet | results - test/test0017/hello-armv7l.sh + test/test0017/run_test.sh armv7l test0018-armv7l-binary: M2-Planet | results - test/test0018/hello-armv7l.sh + test/test0018/run_test.sh armv7l test0019-armv7l-binary: M2-Planet | results - test/test0019/hello-armv7l.sh + test/test0019/run_test.sh armv7l test0020-armv7l-binary: M2-Planet | results - test/test0020/hello-armv7l.sh + test/test0020/run_test.sh armv7l test0021-armv7l-binary: M2-Planet | results - test/test0021/hello-armv7l.sh + test/test0021/run_test.sh armv7l test0022-armv7l-binary: M2-Planet | results - test/test0022/hello-armv7l.sh + test/test0022/run_test.sh armv7l test0023-armv7l-binary: M2-Planet | results - test/test0023/hello-armv7l.sh + test/test0023/run_test.sh armv7l test0024-armv7l-binary: M2-Planet | results - test/test0024/hello-armv7l.sh + test/test0024/run_test.sh armv7l test0025-armv7l-binary: M2-Planet | results - test/test0025/hello-armv7l.sh + test/test0025/run_test.sh armv7l test0100-armv7l-binary: M2-Planet | results - test/test0100/hello-armv7l.sh + test/test0100/run_test.sh armv7l test0101-armv7l-binary: M2-Planet | results - test/test0101/hello-armv7l.sh + test/test0101/run_test.sh armv7l test0102-armv7l-binary: M2-Planet | results - test/test0102/hello-armv7l.sh + test/test0102/run_test.sh armv7l test0103-armv7l-binary: M2-Planet | results - test/test0103/hello-armv7l.sh + test/test0103/run_test.sh armv7l test0104-armv7l-binary: M2-Planet | results - test/test0104/hello-armv7l.sh + test/test0104/run_test.sh armv7l test0105-armv7l-binary: M2-Planet | results - test/test0105/hello-armv7l.sh + test/test0105/run_test.sh armv7l test0106-armv7l-binary: M2-Planet | results - test/test0106/hello-armv7l.sh + test/test0106/run_test.sh armv7l test1000-armv7l-binary: M2-Planet | results test/test1000/hello-armv7l.sh test0000-x86-binary: M2-Planet | results - test/test0000/hello-x86.sh + test/test0000/run_test.sh x86 test0001-x86-binary: M2-Planet | results - test/test0001/hello-x86.sh + test/test0001/run_test.sh x86 test0002-x86-binary: M2-Planet | results - test/test0002/hello-x86.sh + test/test0002/run_test.sh x86 test0003-x86-binary: M2-Planet | results - test/test0003/hello-x86.sh + test/test0003/run_test.sh x86 test0004-x86-binary: M2-Planet | results - test/test0004/hello-x86.sh + test/test0004/run_test.sh x86 test0005-x86-binary: M2-Planet | results - test/test0005/hello-x86.sh + test/test0005/run_test.sh x86 test0006-x86-binary: M2-Planet | results - test/test0006/hello-x86.sh + test/test0006/run_test.sh x86 test0007-x86-binary: M2-Planet | results - test/test0007/hello-x86.sh + test/test0007/run_test.sh x86 test0008-x86-binary: M2-Planet | results - test/test0008/hello-x86.sh + test/test0008/run_test.sh x86 test0009-x86-binary: M2-Planet | results - test/test0009/hello-x86.sh + test/test0009/run_test.sh x86 test0010-x86-binary: M2-Planet | results - test/test0010/hello-x86.sh + test/test0010/run_test.sh x86 test0011-x86-binary: M2-Planet | results - test/test0011/hello-x86.sh + test/test0011/run_test.sh x86 test0012-x86-binary: M2-Planet | results - test/test0012/hello-x86.sh + test/test0012/run_test.sh x86 test0013-x86-binary: M2-Planet | results - test/test0013/hello-x86.sh + test/test0013/run_test.sh x86 test0014-x86-binary: M2-Planet | results - test/test0014/hello-x86.sh + test/test0014/run_test.sh x86 test0015-x86-binary: M2-Planet | results - test/test0015/hello-x86.sh + test/test0015/run_test.sh x86 test0016-x86-binary: M2-Planet | results - test/test0016/hello-x86.sh + test/test0016/run_test.sh x86 test0017-x86-binary: M2-Planet | results - test/test0017/hello-x86.sh + test/test0017/run_test.sh x86 test0018-x86-binary: M2-Planet | results - test/test0018/hello-x86.sh + test/test0018/run_test.sh x86 test0019-x86-binary: M2-Planet | results - test/test0019/hello-x86.sh + test/test0019/run_test.sh x86 test0020-x86-binary: M2-Planet | results - test/test0020/hello-x86.sh + test/test0020/run_test.sh x86 test0021-x86-binary: M2-Planet | results - test/test0021/hello-x86.sh + test/test0021/run_test.sh x86 test0022-x86-binary: M2-Planet | results - test/test0022/hello-x86.sh + test/test0022/run_test.sh x86 test0023-x86-binary: M2-Planet | results - test/test0023/hello-x86.sh + test/test0023/run_test.sh x86 test0024-x86-binary: M2-Planet | results - test/test0024/hello-x86.sh + test/test0024/run_test.sh x86 test0025-x86-binary: M2-Planet | results - test/test0025/hello-x86.sh + test/test0025/run_test.sh x86 test0100-x86-binary: M2-Planet | results - test/test0100/hello-x86.sh + test/test0100/run_test.sh x86 test0101-x86-binary: M2-Planet | results - test/test0101/hello-x86.sh + test/test0101/run_test.sh x86 test0102-x86-binary: M2-Planet | results - test/test0102/hello-x86.sh + test/test0102/run_test.sh x86 test0103-x86-binary: M2-Planet | results - test/test0103/hello-x86.sh + test/test0103/run_test.sh x86 test0104-x86-binary: M2-Planet | results - test/test0104/hello-x86.sh + test/test0104/run_test.sh x86 test0105-x86-binary: M2-Planet | results - test/test0105/hello-x86.sh + test/test0105/run_test.sh x86 test0106-x86-binary: M2-Planet | results - test/test0106/hello-x86.sh + test/test0106/run_test.sh x86 test1000-x86-binary: M2-Planet | results test/test1000/hello-x86.sh diff --git a/test/env.inc.sh b/test/env.inc.sh index d5a96ce..1d47732 100644 --- a/test/env.inc.sh +++ b/test/env.inc.sh @@ -18,21 +18,25 @@ case "${ARCH}" in aarch64) + ARCH_IS_64_BITS="yes" BASE_ADDRESS="0x00400000" BLOOD_ELF_WORD_SIZE_FLAG="--64" ENDIANNESS_FLAG="--little-endian" ;; amd64) + ARCH_IS_64_BITS="yes" BASE_ADDRESS="0x00600000" BLOOD_ELF_WORD_SIZE_FLAG="--64" ENDIANNESS_FLAG="--little-endian" ;; armv7l) + ARCH_IS_64_BITS="no" BASE_ADDRESS="0x00010000" BLOOD_ELF_WORD_SIZE_FLAG="" ENDIANNESS_FLAG="--little-endian" ;; x86) + ARCH_IS_64_BITS="no" BASE_ADDRESS="0x08048000" BLOOD_ELF_WORD_SIZE_FLAG="" ENDIANNESS_FLAG="--little-endian" diff --git a/test/test0008/run_test.sh b/test/test0008/run_test.sh index 87a82af..91a73eb 100755 --- a/test/test0008/run_test.sh +++ b/test/test0008/run_test.sh @@ -69,8 +69,11 @@ hex2 \ if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] then # Verify that the compiled program returns the correct result + EXPECTED=16 + [ "yes" = "${ARCH_IS_64_BITS}" ] && EXPECTED=32 + out=$(./test/results/test0008-${ARCH}-binary 2>&1 ) - [ 32 = $? ] || exit 4 + [ ${EXPECTED} = $? ] || exit 4 [ "$out" = "35419896642975313541989657891634" ] || exit 5 fi exit 0 diff --git a/test/test0010/run_test.sh b/test/test0010/run_test.sh index 1e66d6f..6173626 100755 --- a/test/test0010/run_test.sh +++ b/test/test0010/run_test.sh @@ -59,8 +59,11 @@ hex2 \ if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] then # Verify that the compiled program returns the correct result + EXPECTED=12 + [ "yes" = "${ARCH_IS_64_BITS}" ] && EXPECTED=24 + out=$(./test/results/test0010-${ARCH}-binary 2>&1 ) - [ 24 = $? ] || exit 4 + [ ${EXPECTED} = $? ] || exit 4 [ "$out" = "35419896642975313541989657891634" ] || exit 5 fi exit 0 diff --git a/test/test0020/run_test.sh b/test/test0020/run_test.sh index 074e773..a7e425c 100755 --- a/test/test0020/run_test.sh +++ b/test/test0020/run_test.sh @@ -59,8 +59,11 @@ hex2 \ if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] then # Verify that the compiled program returns the correct result + EXPECTED=20 + [ "yes" = "${ARCH_IS_64_BITS}" ] && EXPECTED=40 + out=$(./test/results/test0020-${ARCH}-binary 2>&1 ) - [ 40 = $? ] || exit 4 + [ ${EXPECTED} = $? ] || exit 4 [ "$out" = "35419896642975313541989657891634" ] || exit 5 fi exit 0 From cb27e5314ae7cd54ac17fdf266ad06c221a0e419 Mon Sep 17 00:00:00 2001 From: deesix Date: Sun, 31 Jan 2021 00:00:00 +0100 Subject: [PATCH 09/10] @@@ remove scripts --- test/test0000/hello-armv7l.sh | 61 ---------------------- test/test0000/hello-x86.sh | 61 ---------------------- test/test0001/hello-armv7l.sh | 66 ------------------------ test/test0001/hello-x86.sh | 66 ------------------------ test/test0002/hello-armv7l.sh | 66 ------------------------ test/test0002/hello-x86.sh | 66 ------------------------ test/test0003/hello-armv7l.sh | 66 ------------------------ test/test0003/hello-x86.sh | 66 ------------------------ test/test0004/hello-armv7l.sh | 66 ------------------------ test/test0004/hello-x86.sh | 66 ------------------------ test/test0005/hello-armv7l.sh | 66 ------------------------ test/test0005/hello-x86.sh | 66 ------------------------ test/test0006/hello-armv7l.sh | 67 ------------------------ test/test0006/hello-x86.sh | 67 ------------------------ test/test0007/hello-armv7l.sh | 67 ------------------------ test/test0007/hello-x86.sh | 67 ------------------------ test/test0008/hello-armv7l.sh | 75 --------------------------- test/test0008/hello-x86.sh | 75 --------------------------- test/test0009/hello-armv7l.sh | 66 ------------------------ test/test0009/hello-x86.sh | 66 ------------------------ test/test0010/hello-armv7l.sh | 66 ------------------------ test/test0010/hello-x86.sh | 66 ------------------------ test/test0011/hello-armv7l.sh | 67 ------------------------ test/test0011/hello-x86.sh | 67 ------------------------ test/test0012/hello-armv7l.sh | 67 ------------------------ test/test0012/hello-x86.sh | 67 ------------------------ test/test0013/hello-armv7l.sh | 67 ------------------------ test/test0013/hello-x86.sh | 67 ------------------------ test/test0014/hello-armv7l.sh | 67 ------------------------ test/test0014/hello-x86.sh | 67 ------------------------ test/test0015/hello-armv7l.sh | 67 ------------------------ test/test0015/hello-x86.sh | 67 ------------------------ test/test0016/hello-armv7l.sh | 67 ------------------------ test/test0016/hello-x86.sh | 67 ------------------------ test/test0017/hello-armv7l.sh | 67 ------------------------ test/test0017/hello-x86.sh | 67 ------------------------ test/test0018/hello-armv7l.sh | 67 ------------------------ test/test0018/hello-x86.sh | 67 ------------------------ test/test0019/hello-armv7l.sh | 71 -------------------------- test/test0019/hello-x86.sh | 71 -------------------------- test/test0020/hello-armv7l.sh | 66 ------------------------ test/test0020/hello-x86.sh | 66 ------------------------ test/test0021/hello-armv7l.sh | 77 ---------------------------- test/test0021/hello-x86.sh | 77 ---------------------------- test/test0022/hello-armv7l.sh | 80 ----------------------------- test/test0022/hello-x86.sh | 80 ----------------------------- test/test0023/hello-armv7l.sh | 77 ---------------------------- test/test0023/hello-x86.sh | 77 ---------------------------- test/test0024/hello-armv7l.sh | 61 ---------------------- test/test0024/hello-x86.sh | 61 ---------------------- test/test0025/hello-armv7l.sh | 76 ---------------------------- test/test0025/hello-x86.sh | 76 ---------------------------- test/test0100/hello-armv7l.sh | 84 ------------------------------- test/test0100/hello-x86.sh | 84 ------------------------------- test/test0101/hello-armv7l.sh | 92 --------------------------------- test/test0101/hello-x86.sh | 92 --------------------------------- test/test0102/hello-armv7l.sh | 95 ----------------------------------- test/test0102/hello-x86.sh | 95 ----------------------------------- test/test0103/hello-armv7l.sh | 77 ---------------------------- test/test0103/hello-x86.sh | 77 ---------------------------- test/test0104/hello-armv7l.sh | 82 ------------------------------ test/test0104/hello-x86.sh | 82 ------------------------------ test/test0105/hello-armv7l.sh | 88 -------------------------------- test/test0105/hello-x86.sh | 88 -------------------------------- test/test0106/hello-armv7l.sh | 67 ------------------------ test/test0106/hello-x86.sh | 75 --------------------------- 66 files changed, 4730 deletions(-) delete mode 100755 test/test0000/hello-armv7l.sh delete mode 100755 test/test0000/hello-x86.sh delete mode 100755 test/test0001/hello-armv7l.sh delete mode 100755 test/test0001/hello-x86.sh delete mode 100755 test/test0002/hello-armv7l.sh delete mode 100755 test/test0002/hello-x86.sh delete mode 100755 test/test0003/hello-armv7l.sh delete mode 100755 test/test0003/hello-x86.sh delete mode 100755 test/test0004/hello-armv7l.sh delete mode 100755 test/test0004/hello-x86.sh delete mode 100755 test/test0005/hello-armv7l.sh delete mode 100755 test/test0005/hello-x86.sh delete mode 100755 test/test0006/hello-armv7l.sh delete mode 100755 test/test0006/hello-x86.sh delete mode 100755 test/test0007/hello-armv7l.sh delete mode 100755 test/test0007/hello-x86.sh delete mode 100755 test/test0008/hello-armv7l.sh delete mode 100755 test/test0008/hello-x86.sh delete mode 100755 test/test0009/hello-armv7l.sh delete mode 100755 test/test0009/hello-x86.sh delete mode 100755 test/test0010/hello-armv7l.sh delete mode 100755 test/test0010/hello-x86.sh delete mode 100755 test/test0011/hello-armv7l.sh delete mode 100755 test/test0011/hello-x86.sh delete mode 100755 test/test0012/hello-armv7l.sh delete mode 100755 test/test0012/hello-x86.sh delete mode 100755 test/test0013/hello-armv7l.sh delete mode 100755 test/test0013/hello-x86.sh delete mode 100755 test/test0014/hello-armv7l.sh delete mode 100755 test/test0014/hello-x86.sh delete mode 100755 test/test0015/hello-armv7l.sh delete mode 100755 test/test0015/hello-x86.sh delete mode 100755 test/test0016/hello-armv7l.sh delete mode 100755 test/test0016/hello-x86.sh delete mode 100755 test/test0017/hello-armv7l.sh delete mode 100755 test/test0017/hello-x86.sh delete mode 100755 test/test0018/hello-armv7l.sh delete mode 100755 test/test0018/hello-x86.sh delete mode 100755 test/test0019/hello-armv7l.sh delete mode 100755 test/test0019/hello-x86.sh delete mode 100755 test/test0020/hello-armv7l.sh delete mode 100755 test/test0020/hello-x86.sh delete mode 100755 test/test0021/hello-armv7l.sh delete mode 100755 test/test0021/hello-x86.sh delete mode 100755 test/test0022/hello-armv7l.sh delete mode 100755 test/test0022/hello-x86.sh delete mode 100755 test/test0023/hello-armv7l.sh delete mode 100755 test/test0023/hello-x86.sh delete mode 100755 test/test0024/hello-armv7l.sh delete mode 100755 test/test0024/hello-x86.sh delete mode 100755 test/test0025/hello-armv7l.sh delete mode 100755 test/test0025/hello-x86.sh delete mode 100755 test/test0100/hello-armv7l.sh delete mode 100755 test/test0100/hello-x86.sh delete mode 100755 test/test0101/hello-armv7l.sh delete mode 100755 test/test0101/hello-x86.sh delete mode 100755 test/test0102/hello-armv7l.sh delete mode 100755 test/test0102/hello-x86.sh delete mode 100755 test/test0103/hello-armv7l.sh delete mode 100755 test/test0103/hello-x86.sh delete mode 100755 test/test0104/hello-armv7l.sh delete mode 100755 test/test0104/hello-x86.sh delete mode 100755 test/test0105/hello-armv7l.sh delete mode 100755 test/test0105/hello-x86.sh delete mode 100755 test/test0106/hello-armv7l.sh delete mode 100755 test/test0106/hello-x86.sh diff --git a/test/test0000/hello-armv7l.sh b/test/test0000/hello-armv7l.sh deleted file mode 100755 index 16d4f6d..0000000 --- a/test/test0000/hello-armv7l.sh +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0000/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f test/test0000/return.c \ - -o ${TMPDIR}/return.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-core.M1 \ - -f ${TMPDIR}/return.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/return.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/return.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0000-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - ./test/results/test0000-${ARCH}-binary - [ 42 = $? ] || exit 3 -fi -exit 0 diff --git a/test/test0000/hello-x86.sh b/test/test0000/hello-x86.sh deleted file mode 100755 index 8646f64..0000000 --- a/test/test0000/hello-x86.sh +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0000/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f test/test0000/return.c \ - -o ${TMPDIR}/return.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-core.M1 \ - -f ${TMPDIR}/return.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/return.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/return.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0000-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - ./test/results/test0000-${ARCH}-binary - [ 42 = $? ] || exit 3 -fi -exit 0 diff --git a/test/test0001/hello-armv7l.sh b/test/test0001/hello-armv7l.sh deleted file mode 100755 index adb8398..0000000 --- a/test/test0001/hello-armv7l.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0001/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0001/library_call.c \ - -o ${TMPDIR}/library_call.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/library_call.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/library_call.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/library_call.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0001-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0001-${ARCH}-binary 2>&1) - [ 42 = $? ] || exit 3 - [ "$out" = "Hello mes" ] || exit 4 -fi -exit 0 diff --git a/test/test0001/hello-x86.sh b/test/test0001/hello-x86.sh deleted file mode 100755 index c8cdfd8..0000000 --- a/test/test0001/hello-x86.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0001/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0001/library_call.c \ - -o ${TMPDIR}/library_call.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/library_call.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/library_call.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/library_call.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0001-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0001-${ARCH}-binary 2>&1) - [ 42 = $? ] || exit 3 - [ "$out" = "Hello mes" ] || exit 4 -fi -exit 0 diff --git a/test/test0002/hello-armv7l.sh b/test/test0002/hello-armv7l.sh deleted file mode 100755 index 5ce220c..0000000 --- a/test/test0002/hello-armv7l.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0002/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0002/if.c \ - -o ${TMPDIR}/if.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/if.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/if.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/if.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0002-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0002-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0002/hello-x86.sh b/test/test0002/hello-x86.sh deleted file mode 100755 index df9e862..0000000 --- a/test/test0002/hello-x86.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0002/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0002/if.c \ - -o ${TMPDIR}/if.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/if.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/if.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/if.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0002-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0002-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0003/hello-armv7l.sh b/test/test0003/hello-armv7l.sh deleted file mode 100755 index a68995b..0000000 --- a/test/test0003/hello-armv7l.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0003/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0003/constant.c \ - -o ${TMPDIR}/constant.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/constant.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/constant.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/constant.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0003-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0003-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0003/hello-x86.sh b/test/test0003/hello-x86.sh deleted file mode 100755 index cc1aad0..0000000 --- a/test/test0003/hello-x86.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0003/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0003/constant.c \ - -o ${TMPDIR}/constant.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/constant.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/constant.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/constant.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0003-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0003-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0004/hello-armv7l.sh b/test/test0004/hello-armv7l.sh deleted file mode 100755 index a56116a..0000000 --- a/test/test0004/hello-armv7l.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0004/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0004/call.c \ - -o ${TMPDIR}/call.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/call.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/call.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/call.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0004-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0004-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0004/hello-x86.sh b/test/test0004/hello-x86.sh deleted file mode 100755 index c77758c..0000000 --- a/test/test0004/hello-x86.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0004/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0004/call.c \ - -o ${TMPDIR}/call.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/call.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/call.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/call.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0004-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0004-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0005/hello-armv7l.sh b/test/test0005/hello-armv7l.sh deleted file mode 100755 index 8a7849d..0000000 --- a/test/test0005/hello-armv7l.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0005/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0005/string.c \ - -o ${TMPDIR}/string.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/string.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/string.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/string.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0005-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0005-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0005/hello-x86.sh b/test/test0005/hello-x86.sh deleted file mode 100755 index 9bee0bb..0000000 --- a/test/test0005/hello-x86.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0005/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0005/string.c \ - -o ${TMPDIR}/string.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/string.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/string.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/string.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0005-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0005-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0006/hello-armv7l.sh b/test/test0006/hello-armv7l.sh deleted file mode 100755 index ce3e5ad..0000000 --- a/test/test0006/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0006/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0006/for.c \ - -o ${TMPDIR}/for.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/for.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/for.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/for.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0006-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0006/hello-x86.sh b/test/test0006/hello-x86.sh deleted file mode 100755 index e4d150c..0000000 --- a/test/test0006/hello-x86.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0006/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0006/for.c \ - -o ${TMPDIR}/for.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/for.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/for.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/for.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0006-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0007/hello-armv7l.sh b/test/test0007/hello-armv7l.sh deleted file mode 100755 index 944e31a..0000000 --- a/test/test0007/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0007/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0007/do.c \ - -o ${TMPDIR}/do.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/do.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/do.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/do.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0007-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0007/hello-x86.sh b/test/test0007/hello-x86.sh deleted file mode 100755 index ef6f009..0000000 --- a/test/test0007/hello-x86.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0007/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0007/do.c \ - -o ${TMPDIR}/do.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/do.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/do.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/do.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0007-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0008/hello-armv7l.sh b/test/test0008/hello-armv7l.sh deleted file mode 100755 index f21c31e..0000000 --- a/test/test0008/hello-armv7l.sh +++ /dev/null @@ -1,75 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0008/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0008/struct.c \ - --debug \ - -o ${TMPDIR}/struct.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/struct.M1 \ - --entry _start \ - -o ${TMPDIR}/struct-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/struct.M1 \ - -f ${TMPDIR}/struct-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/struct.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/struct.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0008-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0008-${ARCH}-binary 2>&1 ) - [ 16 = $? ] || exit 4 - [ "$out" = "35419896642975313541989657891634" ] || exit 5 -fi -exit 0 diff --git a/test/test0008/hello-x86.sh b/test/test0008/hello-x86.sh deleted file mode 100755 index 00a7089..0000000 --- a/test/test0008/hello-x86.sh +++ /dev/null @@ -1,75 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0008/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0008/struct.c \ - --debug \ - -o ${TMPDIR}/struct.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/struct.M1 \ - --entry _start \ - -o ${TMPDIR}/struct-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/struct.M1 \ - -f ${TMPDIR}/struct-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/struct.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/struct.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0008-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0008-${ARCH}-binary 2>&1 ) - [ 16 = $? ] || exit 4 - [ "$out" = "35419896642975313541989657891634" ] || exit 5 -fi -exit 0 diff --git a/test/test0009/hello-armv7l.sh b/test/test0009/hello-armv7l.sh deleted file mode 100755 index 8a7eb88..0000000 --- a/test/test0009/hello-armv7l.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0009/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0009/goto.c \ - -o ${TMPDIR}/goto.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/goto.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/goto.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/goto.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0009-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0009-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0009/hello-x86.sh b/test/test0009/hello-x86.sh deleted file mode 100755 index 0aaac3c..0000000 --- a/test/test0009/hello-x86.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0009/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0009/goto.c \ - -o ${TMPDIR}/goto.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/goto.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/goto.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/goto.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0009-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0009-${ARCH}-binary 2>&1 ) - [ 42 = $? ] || exit 4 - [ "$out" = "Hello mes" ] || exit 5 -fi -exit 0 diff --git a/test/test0010/hello-armv7l.sh b/test/test0010/hello-armv7l.sh deleted file mode 100755 index bb47bf9..0000000 --- a/test/test0010/hello-armv7l.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0010/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0010/nested_struct.c \ - -o ${TMPDIR}/nested_struct.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/nested_struct.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/nested_struct.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/nested_struct.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0010-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0010-${ARCH}-binary 2>&1 ) - [ 12 = $? ] || exit 4 - [ "$out" = "35419896642975313541989657891634" ] || exit 5 -fi -exit 0 diff --git a/test/test0010/hello-x86.sh b/test/test0010/hello-x86.sh deleted file mode 100755 index 180d6ff..0000000 --- a/test/test0010/hello-x86.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0010/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0010/nested_struct.c \ - -o ${TMPDIR}/nested_struct.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/nested_struct.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/nested_struct.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/nested_struct.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0010-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0010-${ARCH}-binary 2>&1 ) - [ 12 = $? ] || exit 4 - [ "$out" = "35419896642975313541989657891634" ] || exit 5 -fi -exit 0 diff --git a/test/test0011/hello-armv7l.sh b/test/test0011/hello-armv7l.sh deleted file mode 100755 index ac34f0b..0000000 --- a/test/test0011/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0011/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0011/break-do.c \ - -o ${TMPDIR}/break-do.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/break-do.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/break-do.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/break-do.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0011-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0011/hello-x86.sh b/test/test0011/hello-x86.sh deleted file mode 100755 index 45f74f2..0000000 --- a/test/test0011/hello-x86.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0011/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0011/break-do.c \ - -o ${TMPDIR}/break-do.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/break-do.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/break-do.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/break-do.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0011-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0012/hello-armv7l.sh b/test/test0012/hello-armv7l.sh deleted file mode 100755 index 5fa9099..0000000 --- a/test/test0012/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0012/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0012/break-for.c \ - -o ${TMPDIR}/break-for.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/break-for.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/break-for.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/break-for.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0012-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0012/hello-x86.sh b/test/test0012/hello-x86.sh deleted file mode 100755 index a073678..0000000 --- a/test/test0012/hello-x86.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0012/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0012/break-for.c \ - -o ${TMPDIR}/break-for.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/break-for.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/break-for.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/break-for.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0012-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0013/hello-armv7l.sh b/test/test0013/hello-armv7l.sh deleted file mode 100755 index 77baeaa..0000000 --- a/test/test0013/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0013/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0013/break-while.c \ - -o ${TMPDIR}/break-while.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/break-while.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/break-while.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/break-while.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0013-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0013/hello-x86.sh b/test/test0013/hello-x86.sh deleted file mode 100755 index fe26046..0000000 --- a/test/test0013/hello-x86.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0013/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0013/break-while.c \ - -o ${TMPDIR}/break-while.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/break-while.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/break-while.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/break-while.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0013-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0014/hello-armv7l.sh b/test/test0014/hello-armv7l.sh deleted file mode 100755 index b7473de..0000000 --- a/test/test0014/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0014/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0014/basic_args.c \ - -o ${TMPDIR}/basic_args.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/basic_args.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/basic_args.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/basic_args.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0014-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 diff --git a/test/test0014/hello-x86.sh b/test/test0014/hello-x86.sh deleted file mode 100755 index 6d8c11a..0000000 --- a/test/test0014/hello-x86.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0014/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0014/basic_args.c \ - -o ${TMPDIR}/basic_args.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/basic_args.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/basic_args.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/basic_args.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0014-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 diff --git a/test/test0015/hello-armv7l.sh b/test/test0015/hello-armv7l.sh deleted file mode 100755 index 18f8b91..0000000 --- a/test/test0015/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0015/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0015/file_read.c \ - -o ${TMPDIR}/file_read.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/file_read.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/file_read.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/file_read.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0015-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0015/hello-x86.sh b/test/test0015/hello-x86.sh deleted file mode 100755 index a921f1c..0000000 --- a/test/test0015/hello-x86.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0015/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0015/file_read.c \ - -o ${TMPDIR}/file_read.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/file_read.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/file_read.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/file_read.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0015-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0016/hello-armv7l.sh b/test/test0016/hello-armv7l.sh deleted file mode 100755 index 6b4c956..0000000 --- a/test/test0016/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0016/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0016/file_write.c \ - -o ${TMPDIR}/file_write.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/file_write.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/file_write.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/file_write.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0016-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0016/hello-x86.sh b/test/test0016/hello-x86.sh deleted file mode 100755 index 485fac5..0000000 --- a/test/test0016/hello-x86.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0016/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0016/file_write.c \ - -o ${TMPDIR}/file_write.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/file_write.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/file_write.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/file_write.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0016-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0017/hello-armv7l.sh b/test/test0017/hello-armv7l.sh deleted file mode 100755 index 4af7621..0000000 --- a/test/test0017/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0017/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0017/memset.c \ - -o ${TMPDIR}/memset.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/memset.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/memset.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/memset.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0017-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0017/hello-x86.sh b/test/test0017/hello-x86.sh deleted file mode 100755 index 13283ab..0000000 --- a/test/test0017/hello-x86.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0017/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0017/memset.c \ - -o ${TMPDIR}/memset.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/memset.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/memset.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/memset.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0017-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0018/hello-armv7l.sh b/test/test0018/hello-armv7l.sh deleted file mode 100755 index 0985213..0000000 --- a/test/test0018/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0018/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0018/math.c \ - -o ${TMPDIR}/math.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/math.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/math.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/math.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0018-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0018/hello-x86.sh b/test/test0018/hello-x86.sh deleted file mode 100755 index 4a7f6fe..0000000 --- a/test/test0018/hello-x86.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0018/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0018/math.c \ - -o ${TMPDIR}/math.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/math.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/math.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/math.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0018-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0019/hello-armv7l.sh b/test/test0019/hello-armv7l.sh deleted file mode 100755 index e362ba5..0000000 --- a/test/test0019/hello-armv7l.sh +++ /dev/null @@ -1,71 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0019/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/file_print.c \ - -f test/test0019/getopt.c \ - -o ${TMPDIR}/getopt.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/getopt.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/getopt.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/getopt.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0019-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0019/hello-x86.sh b/test/test0019/hello-x86.sh deleted file mode 100755 index 8951900..0000000 --- a/test/test0019/hello-x86.sh +++ /dev/null @@ -1,71 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0019/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/file_print.c \ - -f test/test0019/getopt.c \ - -o ${TMPDIR}/getopt.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/getopt.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/getopt.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/getopt.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0019-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -exit 0 diff --git a/test/test0020/hello-armv7l.sh b/test/test0020/hello-armv7l.sh deleted file mode 100755 index 6180e2f..0000000 --- a/test/test0020/hello-armv7l.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0020/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0020/struct.c \ - -o ${TMPDIR}/struct.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/struct.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/struct.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/struct.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0020-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0020-${ARCH}-binary 2>&1 ) - [ 20 = $? ] || exit 4 - [ "$out" = "35419896642975313541989657891634" ] || exit 5 -fi -exit 0 diff --git a/test/test0020/hello-x86.sh b/test/test0020/hello-x86.sh deleted file mode 100755 index cece07b..0000000 --- a/test/test0020/hello-x86.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0020/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0020/struct.c \ - -o ${TMPDIR}/struct.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/struct.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/struct.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/struct.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0020-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0020-${ARCH}-binary 2>&1 ) - [ 20 = $? ] || exit 4 - [ "$out" = "35419896642975313541989657891634" ] || exit 5 -fi -exit 0 diff --git a/test/test0021/hello-armv7l.sh b/test/test0021/hello-armv7l.sh deleted file mode 100755 index 11c2ce1..0000000 --- a/test/test0021/hello-armv7l.sh +++ /dev/null @@ -1,77 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0021/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/match.c \ - -f functions/file_print.c \ - -f test/test0021/chdir.c \ - --debug \ - -o ${TMPDIR}/chdir.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/chdir.M1 \ - --entry _start \ - -o ${TMPDIR}/chdir-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/chdir.M1 \ - -f ${TMPDIR}/chdir-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/chdir.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/chdir.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0021-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0021-${ARCH}-binary - [ 0 = $? ] || exit 5 -fi -exit 0 diff --git a/test/test0021/hello-x86.sh b/test/test0021/hello-x86.sh deleted file mode 100755 index e3c7a5f..0000000 --- a/test/test0021/hello-x86.sh +++ /dev/null @@ -1,77 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0021/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/match.c \ - -f functions/file_print.c \ - -f test/test0021/chdir.c \ - --debug \ - -o ${TMPDIR}/chdir.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/chdir.M1 \ - --entry _start \ - -o ${TMPDIR}/chdir-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/chdir.M1 \ - -f ${TMPDIR}/chdir-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/chdir.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/chdir.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0021-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0021-${ARCH}-binary - [ 0 = $? ] || exit 5 -fi -exit 0 diff --git a/test/test0022/hello-armv7l.sh b/test/test0022/hello-armv7l.sh deleted file mode 100755 index aa46562..0000000 --- a/test/test0022/hello-armv7l.sh +++ /dev/null @@ -1,80 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0022/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/file_print.c \ - -f test/test0022/continue.c \ - --debug \ - -o ${TMPDIR}/continue.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/continue.M1 \ - --entry _start \ - -o ${TMPDIR}/continue-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/continue.M1 \ - -f ${TMPDIR}/continue-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/continue.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/continue.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0022-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -fi -exit 0 diff --git a/test/test0022/hello-x86.sh b/test/test0022/hello-x86.sh deleted file mode 100755 index 4113fbf..0000000 --- a/test/test0022/hello-x86.sh +++ /dev/null @@ -1,80 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0022/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/file_print.c \ - -f test/test0022/continue.c \ - --debug \ - -o ${TMPDIR}/continue.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/continue.M1 \ - --entry _start \ - -o ${TMPDIR}/continue-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/continue.M1 \ - -f ${TMPDIR}/continue-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/continue.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/continue.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0022-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -fi -exit 0 diff --git a/test/test0023/hello-armv7l.sh b/test/test0023/hello-armv7l.sh deleted file mode 100755 index 9ededd5..0000000 --- a/test/test0023/hello-armv7l.sh +++ /dev/null @@ -1,77 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0023/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0023/fseek.c \ - --debug \ - -o ${TMPDIR}/fseek.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/fseek.M1 \ - --entry _start \ - -o ${TMPDIR}/fseek-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/fseek.M1 \ - -f ${TMPDIR}/fseek-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/fseek.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/fseek.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0023-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -fi -exit 0 diff --git a/test/test0023/hello-x86.sh b/test/test0023/hello-x86.sh deleted file mode 100755 index 3c6f774..0000000 --- a/test/test0023/hello-x86.sh +++ /dev/null @@ -1,77 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0023/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0023/fseek.c \ - --debug \ - -o ${TMPDIR}/fseek.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/fseek.M1 \ - --entry _start \ - -o ${TMPDIR}/fseek-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/fseek.M1 \ - -f ${TMPDIR}/fseek-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/fseek.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/fseek.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0023-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./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 -fi -exit 0 diff --git a/test/test0024/hello-armv7l.sh b/test/test0024/hello-armv7l.sh deleted file mode 100755 index a3e0690..0000000 --- a/test/test0024/hello-armv7l.sh +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0024/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f test/test0024/return.c \ - -o ${TMPDIR}/return.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-core.M1 \ - -f ${TMPDIR}/return.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/return.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/return.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0024-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - ./test/results/test0024-${ARCH}-binary - [ 42 = $? ] || exit 3 -fi -exit 0 diff --git a/test/test0024/hello-x86.sh b/test/test0024/hello-x86.sh deleted file mode 100755 index dee960c..0000000 --- a/test/test0024/hello-x86.sh +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0024/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f test/test0024/return.c \ - -o ${TMPDIR}/return.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-core.M1 \ - -f ${TMPDIR}/return.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/return.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/return.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0024-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - ./test/results/test0024-${ARCH}-binary - [ 42 = $? ] || exit 3 -fi -exit 0 diff --git a/test/test0025/hello-armv7l.sh b/test/test0025/hello-armv7l.sh deleted file mode 100755 index b7d2f63..0000000 --- a/test/test0025/hello-armv7l.sh +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0025/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0025/array.c \ - --debug \ - -o ${TMPDIR}/array.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/array.M1 \ - --entry _start \ - -o ${TMPDIR}/array-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/array.M1 \ - -f ${TMPDIR}/array-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/array.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/array.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0025-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0025-${ARCH}-binary 2>| test/test0025/proof || exit 4 - out=$(sha256_check test/test0025/proof.answer) - [ "$out" = "test/test0025/proof: OK" ] || exit 5 -fi -exit 0 diff --git a/test/test0025/hello-x86.sh b/test/test0025/hello-x86.sh deleted file mode 100755 index c55a601..0000000 --- a/test/test0025/hello-x86.sh +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0025/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0025/array.c \ - --debug \ - -o ${TMPDIR}/array.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/array.M1 \ - --entry _start \ - -o ${TMPDIR}/array-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/array.M1 \ - -f ${TMPDIR}/array-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/array.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/array.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0025-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0025-${ARCH}-binary 2>| test/test0025/proof || exit 4 - out=$(sha256_check test/test0025/proof.answer) - [ "$out" = "test/test0025/proof: OK" ] || exit 5 -fi -exit 0 diff --git a/test/test0100/hello-armv7l.sh b/test/test0100/hello-armv7l.sh deleted file mode 100755 index ce19b01..0000000 --- a/test/test0100/hello-armv7l.sh +++ /dev/null @@ -1,84 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0100/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f test/test0100/blood-elf.c \ - --debug \ - -o ${TMPDIR}/blood-elf.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/blood-elf.M1 \ - --entry _start \ - -o ${TMPDIR}/blood-elf-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/blood-elf.M1 \ - -f ${TMPDIR}/blood-elf-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/blood-elf.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/blood-elf.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0100-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0100-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "blood-elf 0.1 -(Basically Launches Odd Object Dump ExecutabLe Files" ] || exit 6 - - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0100-${ARCH}-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 - out=$(sha256_check test/test0100/proof.answer) - [ "$out" = "test/test0100/proof: OK" ] || exit 8 -fi -exit 0 diff --git a/test/test0100/hello-x86.sh b/test/test0100/hello-x86.sh deleted file mode 100755 index ed7e40a..0000000 --- a/test/test0100/hello-x86.sh +++ /dev/null @@ -1,84 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0100/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f test/test0100/blood-elf.c \ - --debug \ - -o ${TMPDIR}/blood-elf.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/blood-elf.M1 \ - --entry _start \ - -o ${TMPDIR}/blood-elf-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/blood-elf.M1 \ - -f ${TMPDIR}/blood-elf-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/blood-elf.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/blood-elf.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0100-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0100-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "blood-elf 0.1 -(Basically Launches Odd Object Dump ExecutabLe Files" ] || exit 6 - - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0100-${ARCH}-binary -f test/test0100/test.M1 -o test/test0100/proof || exit 7 - out=$(sha256_check test/test0100/proof.answer) - [ "$out" = "test/test0100/proof: OK" ] || exit 8 -fi -exit 0 diff --git a/test/test0101/hello-armv7l.sh b/test/test0101/hello-armv7l.sh deleted file mode 100755 index 294e725..0000000 --- a/test/test0101/hello-armv7l.sh +++ /dev/null @@ -1,92 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0101/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f test/test0101/hex2_linker.c \ - --debug \ - -o ${TMPDIR}/hex2_linker.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/hex2_linker.M1 \ - --entry _start \ - -o ${TMPDIR}/hex2_linker-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/hex2_linker.M1 \ - -f ${TMPDIR}/hex2_linker-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/hex2_linker.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/hex2_linker.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0101-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0101-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "hex2 0.3" ] || exit 6 - - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0101-${ARCH}-binary \ - -f M2libc/x86/ELF-x86.hex2 \ - -f test/test0101/test.hex2 \ - --LittleEndian \ - --architecture x86 \ - --BaseAddress 0x8048000 \ - -o test/test0101/proof \ - || exit 7 - out=$(sha256_check test/test0101/proof.answer) - [ "$out" = "test/test0101/proof: OK" ] || exit 8 -fi -exit 0 diff --git a/test/test0101/hello-x86.sh b/test/test0101/hello-x86.sh deleted file mode 100755 index b19b2bf..0000000 --- a/test/test0101/hello-x86.sh +++ /dev/null @@ -1,92 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0101/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f test/test0101/hex2_linker.c \ - --debug \ - -o ${TMPDIR}/hex2_linker.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/hex2_linker.M1 \ - --entry _start \ - -o ${TMPDIR}/hex2_linker-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/hex2_linker.M1 \ - -f ${TMPDIR}/hex2_linker-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/hex2_linker.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/hex2_linker.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0101-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0101-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "hex2 0.3" ] || exit 6 - - . ./sha256.sh - # Verify that the resulting file works - ./test/results/test0101-${ARCH}-binary \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f test/test0101/test.hex2 \ - --LittleEndian \ - --architecture ${ARCH} \ - --BaseAddress 0x8048000 \ - -o test/test0101/proof \ - || exit 7 - out=$(sha256_check test/test0101/proof.answer) - [ "$out" = "test/test0101/proof: OK" ] || exit 8 -fi -exit 0 diff --git a/test/test0102/hello-armv7l.sh b/test/test0102/hello-armv7l.sh deleted file mode 100755 index 12f4258..0000000 --- a/test/test0102/hello-armv7l.sh +++ /dev/null @@ -1,95 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0102/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/string.c \ - -f functions/require.c \ - -f test/test0102/M1-macro.c \ - --debug \ - -o ${TMPDIR}/M1-macro.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/M1-macro.M1 \ - --entry _start \ - -o ${TMPDIR}/M1-macro-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/M1-macro.M1 \ - -f ${TMPDIR}/M1-macro-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/M1-macro.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/M1-macro.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0102-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0102-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "M1 1.0.0" ] || exit 6 - - # Verify that the resulting file works - ./test/results/test0102-${ARCH}-binary \ - -f M2libc/x86/x86_defs.M1 \ - -f M2libc/x86/libc-core.M1 \ - -f test/test0100/test.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture x86 \ - -o test/test0102/proof \ - || exit 7 - - . ./sha256.sh - out=$(sha256_check test/test0102/proof.answer) - [ "$out" = "test/test0102/proof: OK" ] || exit 8 -fi -exit 0 diff --git a/test/test0102/hello-x86.sh b/test/test0102/hello-x86.sh deleted file mode 100755 index 39d00b7..0000000 --- a/test/test0102/hello-x86.sh +++ /dev/null @@ -1,95 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0102/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/string.c \ - -f functions/require.c \ - -f test/test0102/M1-macro.c \ - --debug \ - -o ${TMPDIR}/M1-macro.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/M1-macro.M1 \ - --entry _start \ - -o ${TMPDIR}/M1-macro-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/M1-macro.M1 \ - -f ${TMPDIR}/M1-macro-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/M1-macro.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/M1-macro.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0102-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0102-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "M1 1.0.0" ] || exit 6 - - # Verify that the resulting file works - ./test/results/test0102-${ARCH}-binary \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-core.M1 \ - -f test/test0100/test.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o test/test0102/proof \ - || exit 7 - - . ./sha256.sh - out=$(sha256_check test/test0102/proof.answer) - [ "$out" = "test/test0102/proof: OK" ] || exit 8 -fi -exit 0 diff --git a/test/test0103/hello-armv7l.sh b/test/test0103/hello-armv7l.sh deleted file mode 100755 index 0a3bf74..0000000 --- a/test/test0103/hello-armv7l.sh +++ /dev/null @@ -1,77 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0103/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f test/test0103/get_machine.c \ - --debug \ - -o ${TMPDIR}/get_machine.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/get_machine.M1 \ - --entry _start \ - -o ${TMPDIR}/get_machine-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/get_machine.M1 \ - -f ${TMPDIR}/get_machine-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/get_machine.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/get_machine.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0103-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0103-${ARCH}-binary ${GET_MACHINE_FLAGS} 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "${ARCH}" ] || exit 6 -fi -exit 0 diff --git a/test/test0103/hello-x86.sh b/test/test0103/hello-x86.sh deleted file mode 100755 index ba27295..0000000 --- a/test/test0103/hello-x86.sh +++ /dev/null @@ -1,77 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0103/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f test/test0103/get_machine.c \ - --debug \ - -o ${TMPDIR}/get_machine.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/get_machine.M1 \ - --entry _start \ - -o ${TMPDIR}/get_machine-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/get_machine.M1 \ - -f ${TMPDIR}/get_machine-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/get_machine.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/get_machine.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0103-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0103-${ARCH}-binary ${GET_MACHINE_FLAGS} 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "${ARCH}" ] || exit 6 -fi -exit 0 diff --git a/test/test0104/hello-armv7l.sh b/test/test0104/hello-armv7l.sh deleted file mode 100755 index 38899d0..0000000 --- a/test/test0104/hello-armv7l.sh +++ /dev/null @@ -1,82 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0104/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f test/test0104/kaem.c \ - --debug \ - -o ${TMPDIR}/kaem.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/kaem.M1 \ - --entry _start \ - -o ${TMPDIR}/kaem-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/kaem.M1 \ - -f ${TMPDIR}/kaem-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/kaem.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/kaem.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0104-${ARCH}-binary \ - || exit 4 - -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0104-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "kaem version 0.6.0" ] || exit 6 - - # Verify that the resulting file works - out=$(./test/results/test0104-${ARCH}-binary --file test/test0104/kaem.run) - [ "$out" = "hello world" ] || exit 7 -fi -exit 0 diff --git a/test/test0104/hello-x86.sh b/test/test0104/hello-x86.sh deleted file mode 100755 index 196f6c3..0000000 --- a/test/test0104/hello-x86.sh +++ /dev/null @@ -1,82 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0104/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f functions/file_print.c \ - -f functions/match.c \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f test/test0104/kaem.c \ - --debug \ - -o ${TMPDIR}/kaem.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/kaem.M1 \ - --entry _start \ - -o ${TMPDIR}/kaem-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/kaem.M1 \ - -f ${TMPDIR}/kaem-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/kaem.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/kaem.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0104-${ARCH}-binary \ - || exit 4 - -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0104-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "kaem version 0.6.0" ] || exit 6 - - # Verify that the resulting file works - out=$(./test/results/test0104-${ARCH}-binary --file test/test0104/kaem.run) - [ "$out" = "hello world" ] || exit 7 -fi -exit 0 diff --git a/test/test0105/hello-armv7l.sh b/test/test0105/hello-armv7l.sh deleted file mode 100755 index 1a6439d..0000000 --- a/test/test0105/hello-armv7l.sh +++ /dev/null @@ -1,88 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0105/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0105/lisp.h \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/match.c \ - -f functions/file_print.c \ - -f test/test0105/lisp.c \ - -f test/test0105/lisp_cell.c \ - -f test/test0105/lisp_eval.c \ - -f test/test0105/lisp_print.c \ - -f test/test0105/lisp_read.c \ - --debug \ - -o ${TMPDIR}/lisp.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/lisp.M1 \ - --entry _start \ - -o ${TMPDIR}/lisp-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/lisp.M1 \ - -f ${TMPDIR}/lisp-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/lisp.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/lisp.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0105-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0105-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "Slow_Lisp 0.1" ] || exit 6 - - # Verify that the resulting file works - out=$(./test/results/test0105-${ARCH}-binary --file test/test0105/test.scm) - [ "$out" = "42" ] || exit 7 -fi -exit 0 diff --git a/test/test0105/hello-x86.sh b/test/test0105/hello-x86.sh deleted file mode 100755 index 75e289a..0000000 --- a/test/test0105/hello-x86.sh +++ /dev/null @@ -1,88 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -x - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0105/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0105/lisp.h \ - -f functions/in_set.c \ - -f functions/numerate_number.c \ - -f functions/match.c \ - -f functions/file_print.c \ - -f test/test0105/lisp.c \ - -f test/test0105/lisp_cell.c \ - -f test/test0105/lisp_eval.c \ - -f test/test0105/lisp_print.c \ - -f test/test0105/lisp_read.c \ - --debug \ - -o ${TMPDIR}/lisp.M1 \ - || exit 1 - -# Build debug footer -blood-elf \ - -f ${TMPDIR}/lisp.M1 \ - --entry _start \ - -o ${TMPDIR}/lisp-footer.M1 \ - || exit 2 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/lisp.M1 \ - -f ${TMPDIR}/lisp-footer.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/lisp.hex2 \ - || exit 3 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}-debug.hex2 \ - -f ${TMPDIR}/lisp.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0105-${ARCH}-binary \ - || exit 4 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - # Verify that the compiled program returns the correct result - out=$(./test/results/test0105-${ARCH}-binary --version 2>&1 ) - [ 0 = $? ] || exit 5 - [ "$out" = "Slow_Lisp 0.1" ] || exit 6 - - # Verify that the resulting file works - out=$(./test/results/test0105-${ARCH}-binary --file test/test0105/test.scm) - [ "$out" = "42" ] || exit 7 -fi -exit 0 diff --git a/test/test0106/hello-armv7l.sh b/test/test0106/hello-armv7l.sh deleted file mode 100755 index 6269465..0000000 --- a/test/test0106/hello-armv7l.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="armv7l" -. test/env.inc.sh -TMPDIR="test/test0106/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0106/cc500.c \ - -o ${TMPDIR}/cc0.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/cc0.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/cc0.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/cc0.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0106-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the compiled program can compile itself - ./test/results/test0106-${ARCH}-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 - out=$(sha256_check test/test0106/proof0.answer) - [ "$out" = "test/test0106/cc1: OK" ] || exit 5 -fi -exit 0 diff --git a/test/test0106/hello-x86.sh b/test/test0106/hello-x86.sh deleted file mode 100755 index b6866ff..0000000 --- a/test/test0106/hello-x86.sh +++ /dev/null @@ -1,75 +0,0 @@ -#! /bin/sh -## Copyright (C) 2017 Jeremiah Orians -## Copyright (C) 2021 deesix -## This file is part of M2-Planet. -## -## M2-Planet is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## M2-Planet is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with M2-Planet. If not, see . - -set -ex - -ARCH="x86" -. test/env.inc.sh -TMPDIR="test/test0106/tmp-${ARCH}" - -mkdir -p ${TMPDIR} - -# Build the test -bin/M2-Planet \ - --architecture ${ARCH} \ - -f M2libc/${ARCH}/Linux/unistd.h \ - -f M2libc/stdlib.c \ - -f M2libc/${ARCH}/Linux/fcntl.h \ - -f M2libc/stdio.c \ - -f test/test0106/cc500.c \ - -o ${TMPDIR}/cc0.M1 \ - || exit 1 - -# Macro assemble with libc written in M1-Macro -M1 \ - -f M2libc/${ARCH}/${ARCH}_defs.M1 \ - -f M2libc/${ARCH}/libc-full.M1 \ - -f ${TMPDIR}/cc0.M1 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - -o ${TMPDIR}/cc0.hex2 \ - || exit 2 - -# Resolve all linkages -hex2 \ - -f M2libc/${ARCH}/ELF-${ARCH}.hex2 \ - -f ${TMPDIR}/cc0.hex2 \ - ${ENDIANNESS_FLAG} \ - --architecture ${ARCH} \ - --base-address ${BASE_ADDRESS} \ - -o test/results/test0106-${ARCH}-binary \ - || exit 3 - -# Ensure binary works if host machine supports test -if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ] -then - . ./sha256.sh - # Verify that the compiled program can compile itself - ./test/results/test0106-${ARCH}-binary < test/test0106/cc500.c >| test/test0106/cc1 || exit 4 - out=$(sha256_check test/test0106/proof0.answer) - [ "$out" = "test/test0106/cc1: OK" ] || exit 5 - - # Make it executable - chmod u+x test/test0106/cc1 - - # Verify that the result of it compiling itself can compile itself - ./test/test0106/cc1 < test/test0106/cc500.c >| test/test0106/cc2 || exit 6 - out=$(sha256_check test/test0106/proof1.answer) - [ "$out" = "test/test0106/cc2: OK" ] || exit 7 -fi -exit 0 From 17c4c6b9779ca37d3dfdbfbd686976d981a5d224 Mon Sep 17 00:00:00 2001 From: deesix Date: Sun, 31 Jan 2021 00:00:00 +0100 Subject: [PATCH 10/10] @@@ tests: -e (errexit) shell option in scripts, where possible Some test scripts run programs that return non-zero values for correct outcome; those would fail the shell -e checks. But some scripts not using -e are fine with it because we expect zero or the error condition is handled otherwise. So, for robustness, the option is added into them. --- test/test0021/hello-knight-posix.sh | 2 +- test/test0021/run_test.sh | 2 +- test/test0022/hello-knight-posix.sh | 2 +- test/test0022/run_test.sh | 2 +- test/test0023/hello-knight-posix.sh | 2 +- test/test0023/run_test.sh | 2 +- test/test0100/hello-knight-posix.sh | 2 +- test/test0100/run_test.sh | 2 +- test/test0101/hello-knight-posix.sh | 2 +- test/test0101/run_test.sh | 2 +- test/test0102/hello-knight-posix.sh | 2 +- test/test0102/run_test.sh | 2 +- test/test0103/hello-knight-posix.sh | 2 +- test/test0103/run_test.sh | 2 +- test/test0104/run_test.sh | 2 +- test/test0105/run_test.sh | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/test0021/hello-knight-posix.sh b/test/test0021/hello-knight-posix.sh index 31c8303..d314de5 100755 --- a/test/test0021/hello-knight-posix.sh +++ b/test/test0021/hello-knight-posix.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex TMPDIR="test/test0021/tmp-knight-posix" mkdir -p ${TMPDIR} diff --git a/test/test0021/run_test.sh b/test/test0021/run_test.sh index 53ef473..6b87260 100755 --- a/test/test0021/run_test.sh +++ b/test/test0021/run_test.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex ARCH="$1" . test/env.inc.sh diff --git a/test/test0022/hello-knight-posix.sh b/test/test0022/hello-knight-posix.sh index ea9719e..34760a5 100755 --- a/test/test0022/hello-knight-posix.sh +++ b/test/test0022/hello-knight-posix.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex TMPDIR="test/test0022/tmp-knight-posix" mkdir -p ${TMPDIR} diff --git a/test/test0022/run_test.sh b/test/test0022/run_test.sh index 6f11731..728a1d8 100755 --- a/test/test0022/run_test.sh +++ b/test/test0022/run_test.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex ARCH="$1" . test/env.inc.sh diff --git a/test/test0023/hello-knight-posix.sh b/test/test0023/hello-knight-posix.sh index 4250a78..aa8afce 100755 --- a/test/test0023/hello-knight-posix.sh +++ b/test/test0023/hello-knight-posix.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex TMPDIR="test/test0023/tmp-knight-posix" mkdir -p ${TMPDIR} diff --git a/test/test0023/run_test.sh b/test/test0023/run_test.sh index 62a3121..93a2daa 100755 --- a/test/test0023/run_test.sh +++ b/test/test0023/run_test.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex ARCH="$1" . test/env.inc.sh diff --git a/test/test0100/hello-knight-posix.sh b/test/test0100/hello-knight-posix.sh index 87a497d..50b39d1 100755 --- a/test/test0100/hello-knight-posix.sh +++ b/test/test0100/hello-knight-posix.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex TMPDIR="test/test0100/tmp-knight-posix" mkdir -p ${TMPDIR} diff --git a/test/test0100/run_test.sh b/test/test0100/run_test.sh index 7386c56..c3fd31f 100755 --- a/test/test0100/run_test.sh +++ b/test/test0100/run_test.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex ARCH="$1" . test/env.inc.sh diff --git a/test/test0101/hello-knight-posix.sh b/test/test0101/hello-knight-posix.sh index de0eb4a..0af28a9 100755 --- a/test/test0101/hello-knight-posix.sh +++ b/test/test0101/hello-knight-posix.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex TMPDIR="test/test0101/tmp-knight-posix" mkdir -p ${TMPDIR} diff --git a/test/test0101/run_test.sh b/test/test0101/run_test.sh index 3a09938..c94ed4a 100755 --- a/test/test0101/run_test.sh +++ b/test/test0101/run_test.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex ARCH="$1" . test/env.inc.sh diff --git a/test/test0102/hello-knight-posix.sh b/test/test0102/hello-knight-posix.sh index d4ff6bd..6bb82e7 100755 --- a/test/test0102/hello-knight-posix.sh +++ b/test/test0102/hello-knight-posix.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex TMPDIR="test/test0102/tmp-knight-posix" mkdir -p ${TMPDIR} diff --git a/test/test0102/run_test.sh b/test/test0102/run_test.sh index a27199b..8d43cb1 100755 --- a/test/test0102/run_test.sh +++ b/test/test0102/run_test.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex ARCH="$1" . test/env.inc.sh diff --git a/test/test0103/hello-knight-posix.sh b/test/test0103/hello-knight-posix.sh index e568e1b..62bb0d7 100755 --- a/test/test0103/hello-knight-posix.sh +++ b/test/test0103/hello-knight-posix.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex TMPDIR="test/test0103/tmp-knight-posix" mkdir -p ${TMPDIR} diff --git a/test/test0103/run_test.sh b/test/test0103/run_test.sh index ee61c4a..cc39376 100755 --- a/test/test0103/run_test.sh +++ b/test/test0103/run_test.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex ARCH="$1" . test/env.inc.sh diff --git a/test/test0104/run_test.sh b/test/test0104/run_test.sh index 7ab2367..19cc25e 100755 --- a/test/test0104/run_test.sh +++ b/test/test0104/run_test.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex ARCH="$1" . test/env.inc.sh diff --git a/test/test0105/run_test.sh b/test/test0105/run_test.sh index 60dba5c..48cb56e 100755 --- a/test/test0105/run_test.sh +++ b/test/test0105/run_test.sh @@ -16,7 +16,7 @@ ## You should have received a copy of the GNU General Public License ## along with M2-Planet. If not, see . -set -x +set -ex ARCH="$1" . test/env.inc.sh