aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJames Pollard <james@pollard.dev>2020-06-12 17:48:51 +0100
committerJames Pollard <james@pollard.dev>2020-06-12 17:48:51 +0100
commitf7795011ea9ac0d34ee565d3832f15b649bf1827 (patch)
treefd731b58626c8665032afd62068ece8cedc76eb0 /test
parent9acb804500b590edbff66cd802216f58dde169cd (diff)
parent86f42b92d87020875e2a7ef4ba40de12d261685f (diff)
downloadvericert-kvx-f7795011ea9ac0d34ee565d3832f15b649bf1827.tar.gz
vericert-kvx-f7795011ea9ac0d34ee565d3832f15b649bf1827.zip
Merge branch 'master' into arrays-proof
Diffstat (limited to 'test')
-rw-r--r--test/array.c4
-rw-r--r--test/function.c10
-rwxr-xr-xtest/test_all.sh2
3 files changed, 15 insertions, 1 deletions
diff --git a/test/array.c b/test/array.c
new file mode 100644
index 0000000..e33d47b
--- /dev/null
+++ b/test/array.c
@@ -0,0 +1,4 @@
+int main() {
+ int x[5] = {1, 2, 3, 4, 5};
+ return x[2];
+}
diff --git a/test/function.c b/test/function.c
new file mode 100644
index 0000000..0ac0fcd
--- /dev/null
+++ b/test/function.c
@@ -0,0 +1,10 @@
+int f(int a, int b) {
+ return a * b;
+}
+
+int main() {
+ int x, y;
+ x = 5;
+ y = 18;
+ return f(x, y);
+}
diff --git a/test/test_all.sh b/test/test_all.sh
index 67b5c8f..371ed0e 100755
--- a/test/test_all.sh
+++ b/test/test_all.sh
@@ -30,7 +30,7 @@ for cfile in $test_dir/*.c; do
gcc -o $outbase.gcc $cfile
$outbase.gcc
expected=$?
- ./bin/coqup --hls -drtl -o $outbase.v $cfile
+ ./bin/coqup -drtl -o $outbase.v $cfile
iverilog -o $outbase.iverilog $outbase.v
actual=$($outbase.iverilog | sed -E -e 's/[^0-9]+([0-9]+)/\1/')
if [[ $expected = $actual ]]; then