Merge remote-tracking branch 'deesix/TMP'

This commit is contained in:
Jeremiah Orians 2021-02-17 23:01:23 -05:00
commit 163dab268c
No known key found for this signature in database
GPG Key ID: 6B3A3F198708F894
142 changed files with 823 additions and 7497 deletions

View File

@ -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
@ -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

48
test/env.inc.sh Normal file
View File

@ -0,0 +1,48 @@
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
# To be sourced from test scripts, with ARCH already set.
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"
;;
*)
echo "$0: Unknown architecture (${ARCH})."
exit 77
;;
esac

View File

@ -30,7 +30,7 @@ c3a3da0b2ac7ef462caac44852c8a5eb368e3bf7d1cda9353b35d5a595df81a0 test/results/t
2a1d89cb448190ffa361da3d50d6c8de86c5f5a676898d75bd6d88663b3b3aeb test/results/test0004-x86-binary
5b222eeca4293ed3612fa1fca6275c849235831d8bb801ae299f429a712b9403 test/results/test0005-aarch64-binary
c68c4ef34f81a44e65d3d6e8849273fde3ab092bb64413104fc04e2afba3eb38 test/results/test0005-amd64-binary
02eaf979cb1711a7cd590dc23beaa6d2c6573cce34e07fdecb9932f26c14639c test/results/test0005-armv7l-binary
adfd4764d18b06b69dcd710a2681cf6bcd71796afc870eb84fad95cd9d34d290 test/results/test0005-armv7l-binary
0c6158b6ff964ea83af1b4b7421a52ea5c045b2801dfe15a5364fe51870bb4cc test/results/test0005-knight-native-binary
e34e9968c82ea72554359da38d92d0a8c68259b83d14d8f99897b4e269f13715 test/results/test0005-knight-posix-binary
037d1ac518d74124f6aaf6c6cacd35d38b3a6091786708cc8bcc3f42559bdb20 test/results/test0005-x86-binary
@ -40,7 +40,7 @@ c2deb2f279d9f25685625f94f5db4a2307f59e4bdfdde6f85cf298519967dca4 test/results/t
d15bef3d26121ee7dc05826cc1b6bddf4babd1274ae4fc30dd0733705fd44d7d test/results/test0006-knight-native-binary
03610aa9f4409e29deea14ba2920a73369981b61d9e2efb53999ae472fb09e62 test/results/test0006-knight-posix-binary
6f8f93562ff5df512247524c9b8f1b106e80fedd4be690a18cdc56a6248dccf0 test/results/test0006-x86-binary
ea5caeeaf5b40793015106ca0dd2079955e80bb32cf3e102bc736c3e6c39292d test/results/test0007-aarch64-binary
926162d7f1dcfcd46e6d5826b9a3a65ceb62585fe11d5a28aed88be96613603f test/results/test0007-aarch64-binary
8004a374f99731e1c264277e89a13b6ce509e5af8dd91f307f4a36ae3010900c test/results/test0007-amd64-binary
5132b08ba97c02927a70787b99bc58e82398e1d11845bcac3ef1b8aed0a922a1 test/results/test0007-armv7l-binary
6489afacdb23afec9e6642abe2c4665653cbeebe91566a84985912351d03137b test/results/test0007-knight-native-binary
@ -48,7 +48,7 @@ ea5caeeaf5b40793015106ca0dd2079955e80bb32cf3e102bc736c3e6c39292d test/results/t
0d7e91161bd88505373e9c6f814ce90690d3a945e9f871f1c4f4aba050dad79e test/results/test0007-x86-binary
b8dc6e6fa668ff3e613ae667f972cd6fd3b9e4cc17de1fcfa046e02844bcd906 test/results/test0008-aarch64-binary
c71f68ef9e2741b4dda5490363125a2b11931bf0059eb7cd9bdd595ecb2918a9 test/results/test0008-amd64-binary
0802a44a7cb20af7d157b5cabdef2e969db92495eeebb7a6e11fe83f19740962 test/results/test0008-armv7l-binary
4d9d4401938e94a5ce1d921e7d24df93988dae486546422258d518ddf1374d86 test/results/test0008-armv7l-binary
08697dd3d8758b1a2ee55beb7b39ced1dd0abcc03dc5e3626ac1444a46880b56 test/results/test0008-knight-native-binary
b333157869634e98ade87b5892459bd3afebb2e38d9736f914e520f0c752dcbb test/results/test0008-knight-posix-binary
17b5f6861c7344f2a210f13fef955b8077181068df71b3041dd08a23a1c2f4e1 test/results/test0008-x86-binary
@ -145,7 +145,7 @@ b4dfdb3f7cef6571968fadd3e586a19226a546b3d470cafb8b7c556e1d2d3bfd test/results/t
1077826dafc5ac7f1819357319a3d750ae982d83a8d25bedccde287f5f805a4f test/results/test0025-amd64-binary
b034a738a04ec6c717abdc417b0733f3408af9961b264639444860d481f0db2b test/results/test0025-armv7l-binary
d1b69f0bb8022d55cd1aa5b532ece08f3f70f222c4728130397dc837fc30102e test/results/test0025-x86-binary
23e2e22bfe9f432f35c53552c6b3e1a47182f7c1a4e48cf1b9b7b67189ba35b7 test/results/test0100-aarch64-binary
e7b32b5086a7d631a545d05ef512c70f741fc35165eebfee9a4075993d56038a test/results/test0100-aarch64-binary
6aa42a4ce991607ff88d346b5c7c7b3ad45ef586f0ee02aba3452f3739b9dfb1 test/results/test0100-amd64-binary
9e09b53286eb6dee4db32d847d67fcf3c2eb53e473be92de2ee4856afaf8dea7 test/results/test0100-armv7l-binary
a0f44a9a1ba083063b9a757eb808fecede995ad1319c6c67214ac1cd156ef653 test/results/test0100-knight-posix-binary
@ -173,7 +173,7 @@ a1ba562bdb81c0451507f3b12949f50bfdf5151ed2cf583398f8d00db3242835 test/results/t
99f5ea70b5e2ca0ca67cdd230c19f467e4d62a860aa46c787e87c7a1c3f990d1 test/results/test0105-amd64-binary
487b2c5d6920ead036f19a47615b87821ecb2178949e60702f18bb546586c147 test/results/test0105-armv7l-binary
1a0d21925bf43cf6b4833a2a9350a4b1b08d6e8f5858b79116abf1c66ee1f3f5 test/results/test0105-x86-binary
bb3079247b42191a7bd60b5bec6a8235ff8370628724b5cc2a585b695fd01170 test/results/test0106-aarch64-binary
7f8bb01babab389d69f8b61221cf9e487ec6b7bb1aff6f0a4dee89d98056e0c9 test/results/test0106-aarch64-binary
53e1b665d4ab05c821ff6e1873a5b2475661a509030318f3067ae55ff08a26d7 test/results/test0106-amd64-binary
699897f817fc4df837ab1ea5c507361a4e6bd73214bb9920c3edd79d6abde06b test/results/test0106-armv7l-binary
4b02919462685bcfa15d66b7e11eace031d3f424750f89cc4d0bb739fbfb5123 test/results/test0106-knight-native-binary

View File

@ -1,58 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0000/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-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 ${TMPDIR}/return.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0000-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0000-amd64-binary
[ 42 = $? ] || exit 3
fi
exit 0

View File

@ -1,58 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0000/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-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 ${TMPDIR}/return.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0000-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0000-armv7l-binary
[ 42 = $? ] || exit 3
fi
exit 0

View File

@ -1,58 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0000/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-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 ${TMPDIR}/return.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/return.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/return.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0000-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0000-x86-binary
[ 42 = $? ] || exit 3
fi
exit 0

View File

@ -18,41 +18,44 @@
set -x
TMPDIR="test/test0000/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0000-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
./test/results/test0000-aarch64-binary
./test/results/test0000-${ARCH}-binary
[ 42 = $? ] || exit 4
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0001/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/library_call.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/library_call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/library_call.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0001-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0001-amd64-binary 2>&1)
[ 42 = $? ] || exit 3
[ "$out" = "Hello mes" ] || exit 4
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0001/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/library_call.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/library_call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/library_call.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0001-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0001-armv7l-binary 2>&1)
[ 42 = $? ] || exit 3
[ "$out" = "Hello mes" ] || exit 4
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0001/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/library_call.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/library_call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/library_call.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0001-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0001-x86-binary 2>&1)
[ 42 = $? ] || exit 3
[ "$out" = "Hello mes" ] || exit 4
fi
exit 0

View File

@ -18,15 +18,18 @@
set -x
TMPDIR="test/test0001/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0001-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0001-aarch64-binary 2>&1)
out=$(./test/results/test0001-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 3
[ "$out" = "Hello mes" ] || exit 4
fi

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0002/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/if.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/if.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/if.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0002-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0002-amd64-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0002/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/if.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/if.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/if.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0002-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0002-armv7l-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0002/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/if.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/if.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/if.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0002-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0002-x86-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -x
TMPDIR="test/test0002/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0002-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0002-aarch64-binary 2>&1)
out=$(./test/results/test0002-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0003/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/constant.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/constant.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/constant.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0003-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0003-amd64-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0003/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/constant.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/constant.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/constant.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0003-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0003-armv7l-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0003/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/constant.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/constant.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/constant.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0003-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0003-x86-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -x
TMPDIR="test/test0003/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0003-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0003-aarch64-binary 2>&1)
out=$(./test/results/test0003-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0004/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/call.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/call.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0004-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0004-amd64-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0004/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/call.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/call.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0004-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0004-armv7l-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0004/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/call.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/call.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/call.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0004-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0004-x86-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -x
TMPDIR="test/test0004/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0004-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0004-aarch64-binary 2>&1)
out=$(./test/results/test0004-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0005/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/string.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/string.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/string.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0005-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0005-amd64-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -1,70 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0005/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-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 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l-debug.hex2 \
-f ${TMPDIR}/string.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0005-armv7l-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0005-armv7l-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0005/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/string.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/string.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/string.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0005-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0005-x86-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -x
TMPDIR="test/test0005/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0005-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0005-aarch64-binary 2>&1)
out=$(./test/results/test0005-${ARCH}-binary 2>&1)
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0006/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/for.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/for.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0006-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0006-amd64-binary >| test/test0006/proof || exit 4
out=$(sha256_check test/test0006/proof.answer)
[ "$out" = "test/test0006/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0006/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/for.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/for.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0006-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0006-armv7l-binary >| test/test0006/proof || exit 4
out=$(sha256_check test/test0006/proof.answer)
[ "$out" = "test/test0006/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0006/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/for.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/for.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0006-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0006-x86-binary >| test/test0006/proof || exit 4
out=$(sha256_check test/test0006/proof.answer)
[ "$out" = "test/test0006/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0006/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0006-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0006-aarch64-binary >| test/test0006/proof || exit 4
./test/results/test0006-${ARCH}-binary >| test/test0006/proof || exit 4
out=$(sha256_check test/test0006/proof.answer)
[ "$out" = "test/test0006/proof: OK" ] || exit 5
fi

View File

@ -1,75 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2020-2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0007/tmp-aarch64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture aarch64 \
-f M2libc/aarch64/Linux/unistd.h \
-f M2libc/stdlib.c \
-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 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/aarch64/ELF-aarch64-debug.hex2 \
-f ${TMPDIR}/do.hex2 \
--little-endian \
--architecture aarch64 \
--base-address 0x400000 \
-o test/results/test0007-aarch64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0007-aarch64-binary >| test/test0007/proof || exit 4
out=$(sha256_check test/test0007/proof.answer)
[ "$out" = "test/test0007/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0007/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/do.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/do.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0007-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0007-amd64-binary >| test/test0007/proof || exit 4
out=$(sha256_check test/test0007/proof.answer)
[ "$out" = "test/test0007/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0007/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/do.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/do.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0007-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0007-armv7l-binary >| test/test0007/proof || exit 4
out=$(sha256_check test/test0007/proof.answer)
[ "$out" = "test/test0007/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,6 +1,6 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## Copyright (C) 2020-2021 deesix <deesix@tuta.io>
## This file is part of M2-Planet.
##
## M2-Planet is free software: you can redistribute it and/or modify
@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0007/tmp-x86"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x8048000 \
-o test/results/test0007-x86-binary \
${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})" = "x86" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0007-x86-binary >| test/test0007/proof || exit 4
./test/results/test0007-${ARCH}-binary >| test/test0007/proof || exit 4
out=$(sha256_check test/test0007/proof.answer)
[ "$out" = "test/test0007/proof: OK" ] || exit 5
fi

View File

@ -1,73 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0008/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
-f ${TMPDIR}/struct-footer.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64-debug.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0008-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0008-amd64-binary 2>&1 )
[ 32 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0008/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/Linux/fcntl.h \
-f M2libc/stdio.c \
-f test/test0008/struct.c \
-o ${TMPDIR}/struct.M1 \
|| exit 1
# 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 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0008-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0008-armv7l-binary 2>&1 )
[ 16 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -1,72 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0008/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
-f ${TMPDIR}/struct-footer.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86-debug.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0008-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0008-x86-binary 2>&1 )
[ 16 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -x
TMPDIR="test/test0008/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 \
@ -35,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 \
@ -43,31 +46,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}/struct.M1 \
-f ${TMPDIR}/struct-footer.M1 \
--little-endian \
--architecture aarch64 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0008-aarch64-binary \
${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})" = "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 )
[ 32 = $? ] || exit 4
EXPECTED=16
[ "yes" = "${ARCH_IS_64_BITS}" ] && EXPECTED=32
out=$(./test/results/test0008-${ARCH}-binary 2>&1 )
[ ${EXPECTED} = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0009/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/goto.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/goto.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/goto.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0009-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0009-amd64-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0009/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/goto.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/goto.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/goto.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0009-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0009-armv7l-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0009/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/goto.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/goto.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/goto.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0009-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0009-x86-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -x
TMPDIR="test/test0009/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0009-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0009-aarch64-binary 2>&1 )
out=$(./test/results/test0009-${ARCH}-binary 2>&1 )
[ 42 = $? ] || exit 4
[ "$out" = "Hello mes" ] || exit 5
fi

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0010/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/nested_struct.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/nested_struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/nested_struct.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0010-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0010-amd64-binary 2>&1 )
[ 24 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0010/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/nested_struct.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/nested_struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/nested_struct.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0010-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0010-armv7l-binary 2>&1 )
[ 12 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0010/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/nested_struct.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/nested_struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/nested_struct.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0010-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0010-x86-binary 2>&1 )
[ 12 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -x
TMPDIR="test/test0010/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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,30 +37,33 @@ 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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0010-aarch64-binary \
${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})" = "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 )
[ 24 = $? ] || exit 4
EXPECTED=12
[ "yes" = "${ARCH_IS_64_BITS}" ] && EXPECTED=24
out=$(./test/results/test0010-${ARCH}-binary 2>&1 )
[ ${EXPECTED} = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0011/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/break-do.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/break-do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/break-do.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0011-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0011-amd64-binary >| test/test0011/proof || exit 4
out=$(sha256_check test/test0011/proof.answer)
[ "$out" = "test/test0011/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0011/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/break-do.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/break-do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/break-do.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0011-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0011-armv7l-binary >| test/test0011/proof || exit 4
out=$(sha256_check test/test0011/proof.answer)
[ "$out" = "test/test0011/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0011/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/break-do.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/break-do.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/break-do.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0011-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0011-x86-binary >| test/test0011/proof || exit 4
out=$(sha256_check test/test0011/proof.answer)
[ "$out" = "test/test0011/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0011/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0011-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0011-aarch64-binary >| test/test0011/proof || exit 4
./test/results/test0011-${ARCH}-binary >| test/test0011/proof || exit 4
out=$(sha256_check test/test0011/proof.answer)
[ "$out" = "test/test0011/proof: OK" ] || exit 5
fi

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0012/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/break-for.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/break-for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/break-for.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0012-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0012-amd64-binary >| test/test0012/proof || exit 4
out=$(sha256_check test/test0012/proof.answer)
[ "$out" = "test/test0012/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0012/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/break-for.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/break-for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/break-for.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0012-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0012-armv7l-binary >| test/test0012/proof || exit 4
out=$(sha256_check test/test0012/proof.answer)
[ "$out" = "test/test0012/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0012/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/break-for.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/break-for.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/break-for.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0012-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0012-x86-binary >| test/test0012/proof || exit 4
out=$(sha256_check test/test0012/proof.answer)
[ "$out" = "test/test0012/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0012/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0012-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0012-aarch64-binary >| test/test0012/proof || exit 4
./test/results/test0012-${ARCH}-binary >| test/test0012/proof || exit 4
out=$(sha256_check test/test0012/proof.answer)
[ "$out" = "test/test0012/proof: OK" ] || exit 5
fi

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0013/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/break-while.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/break-while.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/break-while.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0013-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0013-amd64-binary >| test/test0013/proof || exit 4
out=$(sha256_check test/test0013/proof.answer)
[ "$out" = "test/test0013/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0013/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/break-while.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/break-while.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/break-while.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0013-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0013-armv7l-binary >| test/test0013/proof || exit 4
out=$(sha256_check test/test0013/proof.answer)
[ "$out" = "test/test0013/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0013/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/break-while.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/break-while.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/break-while.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0013-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0013-x86-binary >| test/test0013/proof || exit 4
out=$(sha256_check test/test0013/proof.answer)
[ "$out" = "test/test0013/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0013/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0013-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0013-aarch64-binary >| test/test0013/proof || exit 4
./test/results/test0013-${ARCH}-binary >| test/test0013/proof || exit 4
out=$(sha256_check test/test0013/proof.answer)
[ "$out" = "test/test0013/proof: OK" ] || exit 5
fi

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0014/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/basic_args.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/basic_args.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/basic_args.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0014-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
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)
[ "$out" = "test/test0014/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0014/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/basic_args.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/basic_args.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/basic_args.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0014-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
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)
[ "$out" = "test/test0014/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0014/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/basic_args.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/basic_args.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/basic_args.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0014-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
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)
[ "$out" = "test/test0014/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0014/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0014-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0014-aarch64-binary 314 1 5926 5 35897 932384626 43 383279 50288 419 71693 99375105 820974944 >| test/test0014/proof || exit 4
out=$(sha256_check test/test0014/proof-aarch64.answer)
./test/results/test0014-${ARCH}-binary 314 1 5926 5 35897 932384626 43 383279 50288 419 71693 99375105 820974944 >| test/test0014/proof || exit 4
out=$(sha256_check test/test0014/proof-${ARCH}.answer)
[ "$out" = "test/test0014/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0015/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/file_read.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/file_read.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/file_read.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0015-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0015-amd64-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

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0015/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/file_read.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/file_read.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/file_read.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0015-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0015-armv7l-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

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0015/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/file_read.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/file_read.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/file_read.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0015-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0015-x86-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

View File

@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0015/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0015-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0015-aarch64-binary test/test0015/file_read.c >| test/test0015/proof || exit 4
./test/results/test0015-${ARCH}-binary test/test0015/file_read.c >| test/test0015/proof || exit 4
out=$(sha256_check test/test0015/proof.answer)
[ "$out" = "test/test0015/proof: OK" ] || exit 5
fi

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0016/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/file_write.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/file_write.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/file_write.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0016-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0016-amd64-binary test/test0016/proof || exit 4
out=$(sha256_check test/test0016/proof.answer)
[ "$out" = "test/test0016/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0016/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/file_write.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/file_write.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/file_write.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0016-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0016-armv7l-binary test/test0016/proof || exit 4
out=$(sha256_check test/test0016/proof.answer)
[ "$out" = "test/test0016/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0016/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/file_write.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/file_write.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/file_write.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0016-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0016-x86-binary test/test0016/proof || exit 4
out=$(sha256_check test/test0016/proof.answer)
[ "$out" = "test/test0016/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0016/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0016-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0016-aarch64-binary test/test0016/proof || exit 4
./test/results/test0016-${ARCH}-binary test/test0016/proof || exit 4
out=$(sha256_check test/test0016/proof.answer)
[ "$out" = "test/test0016/proof: OK" ] || exit 5
fi

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0017/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/memset.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/memset.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/memset.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0017-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0017-amd64-binary >| test/test0017/proof || exit 4
out=$(sha256_check test/test0017/proof.answer)
[ "$out" = "test/test0017/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0017/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/memset.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/memset.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/memset.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0017-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0017-armv7l-binary >| test/test0017/proof || exit 4
out=$(sha256_check test/test0017/proof.answer)
[ "$out" = "test/test0017/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0017/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/memset.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/memset.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/memset.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0017-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0017-x86-binary >| test/test0017/proof || exit 4
out=$(sha256_check test/test0017/proof.answer)
[ "$out" = "test/test0017/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0017/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0017-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0017-aarch64-binary >| test/test0017/proof || exit 4
./test/results/test0017-${ARCH}-binary >| test/test0017/proof || exit 4
out=$(sha256_check test/test0017/proof.answer)
[ "$out" = "test/test0017/proof: OK" ] || exit 5
fi

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0018/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/math.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/math.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/math.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0018-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0018-amd64-binary >| test/test0018/proof || exit 4
out=$(sha256_check test/test0018/proof.answer)
[ "$out" = "test/test0018/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0018/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/math.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/math.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/math.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0018-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0018-armv7l-binary >| test/test0018/proof || exit 4
out=$(sha256_check test/test0018/proof.answer)
[ "$out" = "test/test0018/proof: OK" ] || exit 5
fi
exit 0

View File

@ -1,64 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0018/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/math.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/math.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/math.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0018-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0018-x86-binary >| test/test0018/proof || exit 4
out=$(sha256_check test/test0018/proof.answer)
[ "$out" = "test/test0018/proof: OK" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0018/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +37,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0018-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0018-aarch64-binary >| test/test0018/proof || exit 4
./test/results/test0018-${ARCH}-binary >| test/test0018/proof || exit 4
out=$(sha256_check test/test0018/proof.answer)
[ "$out" = "test/test0018/proof: OK" ] || exit 5
fi

View File

@ -1,68 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0019/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/getopt.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/getopt.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/getopt.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0019-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0019-amd64-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

View File

@ -1,68 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0019/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/getopt.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/getopt.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/getopt.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0019-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0019-armv7l-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

View File

@ -1,68 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -ex
TMPDIR="test/test0019/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/getopt.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/getopt.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/getopt.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0019-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0019-x86-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

View File

@ -18,15 +18,18 @@
set -ex
TMPDIR="test/test0019/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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 +41,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0019-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0019-aarch64-binary -f test/test0019/input -o test/test0019/proof || exit 4
./test/results/test0019-${ARCH}-binary -f test/test0019/input -o test/test0019/proof || exit 4
out=$(sha256_check test/test0019/proof.answer)
[ "$out" = "test/test0019/proof: OK" ] || exit 5
fi

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0020/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0020-amd64-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0020-amd64-binary 2>&1 )
[ 40 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0020/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0020-armv7l-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0020-armv7l-binary 2>&1 )
[ 20 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -1,63 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0020/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/struct.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/struct.hex2 \
|| exit 2
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86.hex2 \
-f ${TMPDIR}/struct.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0020-x86-binary \
|| exit 3
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test0020-x86-binary 2>&1 )
[ 20 = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -18,15 +18,18 @@
set -x
TMPDIR="test/test0020/tmp-aarch64"
ARCH="$1"
. test/env.inc.sh
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,30 +37,33 @@ 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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0020-aarch64-binary \
${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})" = "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 )
[ 40 = $? ] || exit 4
EXPECTED=20
[ "yes" = "${ARCH_IS_64_BITS}" ] && EXPECTED=40
out=$(./test/results/test0020-${ARCH}-binary 2>&1 )
[ ${EXPECTED} = $? ] || exit 4
[ "$out" = "35419896642975313541989657891634" ] || exit 5
fi
exit 0

View File

@ -1,75 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0021/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/chdir.M1 \
-f ${TMPDIR}/chdir-footer.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/chdir.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64-debug.hex2 \
-f ${TMPDIR}/chdir.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0021-amd64-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0021-amd64-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -1,74 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0021/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/chdir.M1 \
-f ${TMPDIR}/chdir-footer.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/chdir.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l-debug.hex2 \
-f ${TMPDIR}/chdir.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0021-armv7l-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0021-armv7l-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -16,7 +16,7 @@
## You should have received a copy of the GNU General Public License
## along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
set -ex
TMPDIR="test/test0021/tmp-knight-posix"
mkdir -p ${TMPDIR}

View File

@ -1,74 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0021/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/chdir.M1 \
-f ${TMPDIR}/chdir-footer.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/chdir.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86-debug.hex2 \
-f ${TMPDIR}/chdir.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0021-x86-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0021-x86-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -16,17 +16,20 @@
## You should have received a copy of the GNU General Public License
## along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
set -ex
ARCH="$1"
. test/env.inc.sh
TMPDIR="test/test0021/tmp-${ARCH}"
TMPDIR="test/test0021/tmp-aarch64"
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 \
@ -37,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 \
@ -45,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}/chdir.M1 \
-f ${TMPDIR}/chdir-footer.M1 \
--little-endian \
--architecture aarch64 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0021-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0021-aarch64-binary
./test/results/test0021-${ARCH}-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -1,78 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0022/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/continue.M1 \
-f ${TMPDIR}/continue-footer.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/continue.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64-debug.hex2 \
-f ${TMPDIR}/continue.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0022-amd64-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0022-amd64-binary >| test/test0022/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0022/proof.answer)
[ "$out" = "test/test0022/proof: OK" ] || exit 6
fi
exit 0

View File

@ -1,77 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0022/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/continue.M1 \
-f ${TMPDIR}/continue-footer.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/continue.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l-debug.hex2 \
-f ${TMPDIR}/continue.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0022-armv7l-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0022-armv7l-binary >| test/test0022/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0022/proof.answer)
[ "$out" = "test/test0022/proof: OK" ] || exit 6
fi
exit 0

View File

@ -16,7 +16,7 @@
## You should have received a copy of the GNU General Public License
## along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
set -ex
TMPDIR="test/test0022/tmp-knight-posix"
mkdir -p ${TMPDIR}

View File

@ -1,77 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0022/tmp-x86"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture x86 \
-f M2libc/x86/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/x86/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/x86/x86_defs.M1 \
-f M2libc/x86/libc-full.M1 \
-f ${TMPDIR}/continue.M1 \
-f ${TMPDIR}/continue-footer.M1 \
--little-endian \
--architecture x86 \
-o ${TMPDIR}/continue.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/x86/ELF-x86-debug.hex2 \
-f ${TMPDIR}/continue.hex2 \
--little-endian \
--architecture x86 \
--base-address 0x8048000 \
-o test/results/test0022-x86-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0022-x86-binary >| test/test0022/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0022/proof.answer)
[ "$out" = "test/test0022/proof: OK" ] || exit 6
fi
exit 0

View File

@ -16,17 +16,20 @@
## You should have received a copy of the GNU General Public License
## along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
set -ex
ARCH="$1"
. test/env.inc.sh
TMPDIR="test/test0022/tmp-${ARCH}"
TMPDIR="test/test0022/tmp-aarch64"
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 \
@ -38,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 \
@ -46,31 +49,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 \
${ENDIANNESS_FLAG} \
--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 \
--base-address 0x400000 \
-o test/results/test0022-aarch64-binary \
${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})" = "aarch64" ]
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "${ARCH}" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0022-aarch64-binary >| test/test0022/proof
./test/results/test0022-${ARCH}-binary >| test/test0022/proof
[ 0 = $? ] || exit 5
out=$(sha256_check test/test0022/proof.answer)
[ "$out" = "test/test0022/proof: OK" ] || exit 6

View File

@ -1,75 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0023/tmp-amd64"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture amd64 \
-f M2libc/amd64/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/amd64/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/amd64/amd64_defs.M1 \
-f M2libc/amd64/libc-full.M1 \
-f ${TMPDIR}/fseek.M1 \
-f ${TMPDIR}/fseek-footer.M1 \
--little-endian \
--architecture amd64 \
-o ${TMPDIR}/fseek.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/amd64/ELF-amd64-debug.hex2 \
-f ${TMPDIR}/fseek.hex2 \
--little-endian \
--architecture amd64 \
--base-address 0x00600000 \
-o test/results/test0023-amd64-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-amd64-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

View File

@ -1,74 +0,0 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2021 deesix <deesix@tuta.io>
## 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 <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0023/tmp-armv7l"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Planet \
--architecture armv7l \
-f M2libc/armv7l/Linux/unistd.h \
-f M2libc/stdlib.c \
-f M2libc/armv7l/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/armv7l/armv7l_defs.M1 \
-f M2libc/armv7l/libc-full.M1 \
-f ${TMPDIR}/fseek.M1 \
-f ${TMPDIR}/fseek-footer.M1 \
--little-endian \
--architecture armv7l \
-o ${TMPDIR}/fseek.hex2 \
|| exit 3
# Resolve all linkages
hex2 \
-f M2libc/armv7l/ELF-armv7l-debug.hex2 \
-f ${TMPDIR}/fseek.hex2 \
--little-endian \
--architecture armv7l \
--base-address 0x10000 \
-o test/results/test0023-armv7l-binary \
|| exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test0023-armv7l-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

View File

@ -16,7 +16,7 @@
## You should have received a copy of the GNU General Public License
## along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
set -ex
TMPDIR="test/test0023/tmp-knight-posix"
mkdir -p ${TMPDIR}

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