summaryrefslogtreecommitdiff
path: root/test/c
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-12-14 15:17:42 +0000
committerAlasdair Armstrong2018-12-14 15:17:42 +0000
commit2dfcbdeedb0ac40d4865aaf5c2202dfba95f4a38 (patch)
treee267b9d9166e3548f71508d9d68b8ea1f35a304d /test/c
parentbfb20a209d1b72c832b4376d6d3c51d39970ef2f (diff)
Add a few more tests for Jenkins
Some of the output from the tests scripts is odd on Jenkins, try to fix this by flushing stdout more regularly in the test scripts
Diffstat (limited to 'test/c')
-rw-r--r--test/c/config.expect6
-rw-r--r--test/c/config.sail34
2 files changed, 40 insertions, 0 deletions
diff --git a/test/c/config.expect b/test/c/config.expect
new file mode 100644
index 00000000..059a413f
--- /dev/null
+++ b/test/c/config.expect
@@ -0,0 +1,6 @@
+x = 3
+Hello
+z = 0xFF
+x = 4
+World
+z = 0xAA
diff --git a/test/c/config.sail b/test/c/config.sail
new file mode 100644
index 00000000..2902d259
--- /dev/null
+++ b/test/c/config.sail
@@ -0,0 +1,34 @@
+default Order dec
+
+$include <arith.sail>
+$include <vector_dec.sail>
+
+val "print" : string -> unit
+
+register q : int
+
+register configuration x : int = 3
+
+register configuration y : string = "Hello\n"
+
+register configuration z : bits(8) = 0xFF
+
+val init : unit -> unit effect {configuration}
+
+function init() = {
+ x = 4;
+ y = "World\n";
+ z = 0xAA;
+}
+
+val main : unit -> unit effect {configuration}
+
+function main() = {
+ print_int("x = ", x);
+ print(y);
+ print_bits("z = ", z);
+ init();
+ print_int("x = ", x);
+ print(y);
+ print_bits("z = ", z);
+} \ No newline at end of file