summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/c/if_opt_typ.expect2
-rw-r--r--test/c/if_opt_typ.sail12
2 files changed, 14 insertions, 0 deletions
diff --git a/test/c/if_opt_typ.expect b/test/c/if_opt_typ.expect
new file mode 100644
index 00000000..d92227c0
--- /dev/null
+++ b/test/c/if_opt_typ.expect
@@ -0,0 +1,2 @@
+x2:18446744073709551615
+x3:18446744073709551615
diff --git a/test/c/if_opt_typ.sail b/test/c/if_opt_typ.sail
new file mode 100644
index 00000000..e51c69ec
--- /dev/null
+++ b/test/c/if_opt_typ.sail
@@ -0,0 +1,12 @@
+default Order dec
+$include <vector_dec.sail>
+$include <string.sail>
+
+val main : unit -> unit
+function main () = {
+ let x1 = 0xffffffffffffffff;
+ let x2 : int = unsigned(x1);
+ let x3 : int = if false then signed(x1) else unsigned(x1);
+ print_int("x2:", x2);
+ print_int("x3:", x3);
+} \ No newline at end of file