aboutsummaryrefslogtreecommitdiffstats
path: root/test/c/cscript.sh
blob: f797df7b932ebc2aed6d2f482f3a1b6fc2af8b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

CCREF="/home/yuki/Work/VERIMAG/Compcert_riscv_bis/ccomp -static -stdlib /home/yuki/Work/VERIMAG/Compcert_riscv_bis/runtime -fno-expanse-rtlcond -fno-expanse-others"
CCTEST="/home/yuki/Work/VERIMAG/Compcert_riscv_third/ccomp -static -stdlib /home/yuki/Work/VERIMAG/Compcert_riscv_third/runtime -fno-expanse-rtlcond -fno-expanse-others"

$CCREF nsieve.c > refout 2>&1
mv a.out ref.out
$CCTEST nsieve.c > testout 2>&1
#sort -k1 -n -t, refout -o refout
#sort -k1 -n -t, testout -o testout
qemu-riscv64 ref.out > logref 2>&1
{ qemu-riscv64 a.out > logtest 2>&1; } 2> logtest
if cat logref | ack "Primes"; then
  if cmp -s logref logtest; then
    exit 1
  else
    exit 0
  fi
else
  exit 1
fi