forked from riscv-software-src/riscv-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
regression.sh
executable file
·36 lines (28 loc) · 930 Bytes
/
regression.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/bash
#
# Script to build RISC-V tools and then test (some of) them.
set -ex
echo "Starting RISC-V Toolchain Regression"
# build the tools
export base_dir=${PWD}
mkdir -p regression_install
export RISCV=${base_dir}/regression_install
./build.sh
# test the tools
export PATH="$RISCV/bin:$PATH"
make -C ${base_dir}/riscv-tests/isa/ run
make -C ${base_dir}/riscv-tests/benchmarks/ run-riscv
# test the pk
echo -e '#include <stdio.h>\n int main(void) { printf("Hello world!\\n"); return 0; }' > hello.c
riscv64-unknown-elf-gcc -o hello hello.c
spike pk hello
# test glibc+pk
rm -rf ${base_dir}/riscv-gnu-toolchain/build
mkdir ${base_dir}/riscv-gnu-toolchain/build
cd ${base_dir}/riscv-gnu-toolchain/build
../configure --prefix=$RISCV
make linux
cd ${base_dir}; rm hello
riscv64-unknown-linux-gnu-gcc -static -Wl,-Ttext-segment,0x10000 -o hello hello.c
spike pk hello
echo -e "\\nRISC-V Toolchain regression completed!"