summaryrefslogtreecommitdiff
path: root/test/c/zero_length_bv.sail
diff options
context:
space:
mode:
authorAlasdair Armstrong2019-04-15 14:35:02 +0100
committerAlasdair Armstrong2019-04-15 14:35:02 +0100
commit4529e0acc377bed4d1bab4230f4023e4bee3ae85 (patch)
tree76f6e8666c2cf12e2eeb95719162362a1b255e31 /test/c/zero_length_bv.sail
parent1f421b865a87a161a82550443a0cf39aa2642d9c (diff)
Fix: Allow zero-length vector literals
Diffstat (limited to 'test/c/zero_length_bv.sail')
-rw-r--r--test/c/zero_length_bv.sail14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/c/zero_length_bv.sail b/test/c/zero_length_bv.sail
new file mode 100644
index 00000000..332b8aae
--- /dev/null
+++ b/test/c/zero_length_bv.sail
@@ -0,0 +1,14 @@
+default Order dec
+
+$include <prelude.sail>
+
+val "print_endline" : string -> unit
+
+function main((): unit) -> unit = {
+ let x: bits(0) = [];
+ if x == sail_zeros(0) then {
+ print_endline("ok")
+ };
+ let x: vector(0, dec, string) = [];
+ ()
+} \ No newline at end of file