Skip to content

Commit cd20f66

Browse files
authored
Merge pull request #67 from bkmgit/mov_tests
Add test for "mov" and "(mov|add|adds|sub|subs)_imm"
2 parents 8dd6af7 + b30181c commit cd20f66

File tree

2 files changed

+126
-1
lines changed

2 files changed

+126
-1
lines changed

test/test_all.sh

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#*******************************************************************************
3-
# Copyright 2019-2020 FUJITSU LIMITED
3+
# Copyright 2019-2022 FUJITSU LIMITED
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
1515
# imitations under the License.
1616
# *******************************************************************************/
1717
nm_list="make_nm make_nm_branch make_nm_fp make_nm_load_store make_nm_simd make_nm_simd_fp_load_store make_nm_sve make_nm_sve_addr"
18+
integrated_list="mov mov_imm add_sub_adds_subs_imm"
1819

1920
do_all_test() {
2021
echo "########################################################"
@@ -36,6 +37,21 @@ do_all_test() {
3637
echo "########################################################"
3738
echo ""
3839
done
40+
for i in ${integrated_list} ;
41+
do
42+
echo "########################################################"
43+
44+
echo "Start test senario=${i}"
45+
./test_integrated.sh ${TEST_OPT} ${i}
46+
if [ $? != 0 ] ;then
47+
echo "err"
48+
exit 1
49+
fi
50+
51+
echo "Finish test senario=${i}"
52+
echo "########################################################"
53+
echo ""
54+
done
3955
}
4056

4157
while getopts gf OPT

test/test_integrated.sh

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#!/bin/sh
2+
#*******************************************************************************
3+
# Copyright 2019-2022 FUJITSU LIMITED
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#******************************************************************************/
17+
#*******************************************************************************
18+
# Default compiler is g++
19+
#*******************************************************************************
20+
TEST_FILE=${1}
21+
AARCH64_TYPE="armv8.4-a"
22+
if [ ${ARCH} = arm64 ] ; then
23+
AARCH64_TYPE="all"
24+
fi
25+
CXX_FLAGS1="-std=c++11 -fomit-frame-pointer -Wall -fno-operator-names -I../xbyak_aarch64 -I./ -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith -Wno-ignored-qualifiers"
26+
CXX_FLAGS2="-std=c++11 -Wall -I../xbyak_aarch64 -DXBYAK_TEST -DXBYAK_USE_MMAP_ALLOCATOR"
27+
28+
#*******************************************************************************
29+
# Function definition
30+
#*******************************************************************************
31+
usage_exit() {
32+
echo "Usage: $0 [-f|-q] TEST_FILE"
33+
echo " [-f] Fujitsu Compiler"
34+
echo " [-q] GCC + QEMU"
35+
exit 1
36+
}
37+
38+
dumpOK () {
39+
echo "##########################################"
40+
echo "# Test OK :-)"
41+
echo "##########################################"
42+
}
43+
44+
dumpNG () {
45+
echo "##########################################"
46+
echo "# $1"
47+
echo "# Test NG :-p"
48+
echo "##########################################"
49+
}
50+
51+
set_variables() {
52+
53+
case $ENV_SELECT in
54+
f) CXX=FCC;
55+
CXX_FLAGS1="-std=c++11 -fomit-frame-pointer -Wall -fno-operator-names -I../xbyak_aarch64 -I./ -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith -Nclang -Knolargepage -Wno-ignored-qualifiers";
56+
CXX_FLAGS2="-Wall -I../xbyak_aarch64 -DXBYAK_TEST -DXBYAK_USE_MMAP_ALLOCATOR -Nclang -Knolargepage";
57+
echo "compiler is FCC"
58+
;;
59+
60+
q) source setenv-qemu
61+
;;
62+
g) source setenv-gcc
63+
;;
64+
*)
65+
;;
66+
esac
67+
}
68+
69+
#*******************************************************************************
70+
# Main routine
71+
#*******************************************************************************
72+
while getopts f: OPT
73+
do
74+
case $OPT in
75+
f) ENV_SELECT=f; TEST_FILE=$OPTARG
76+
;;
77+
q) ENV_SELECT=q; TEST_FILE=$OPTARG
78+
;;
79+
\?) usage_exit
80+
;;
81+
esac
82+
done
83+
#shift $((OPTIND - 1))
84+
85+
set_variables
86+
87+
# Make object files
88+
${CXX} -c ${TEST_FILE}.cpp -o ${TEST_FILE}.o ${CXX_FLAGS1} -MMD -MP -MF ${TEST_FILE}.d
89+
90+
if [ $? != 0 ] ; then
91+
dumpNG "Making object files"
92+
exit 1
93+
fi
94+
95+
# Make binary
96+
${CXX} ${TEST_FILE}.o -o ${TEST_FILE} -L ../lib -lxbyak_aarch64
97+
98+
if [ $? != 0 ] ; then
99+
dumpNG "Compiling binary."
100+
exit 1
101+
fi
102+
103+
104+
# Output
105+
${EMULATOR} ./${TEST_FILE} > ${TEST_FILE}.log 2>&1
106+
if [ $? != 0 ] ;then
107+
dumpNG "Running binary test."
108+
exit 1
109+
fi

0 commit comments

Comments
 (0)