summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/c/exception.sail6
-rw-r--r--test/ocaml/string_of_struct/sos.sail2
-rw-r--r--test/ocaml/trycatch/tc.sail2
-rw-r--r--test/ocaml/types/types.sail6
-rw-r--r--test/typecheck/pass/option_either.sail6
-rw-r--r--test/typecheck/pass/pat_completeness.sail8
-rw-r--r--test/typecheck/pass/union_infer.sail6
7 files changed, 18 insertions, 18 deletions
diff --git a/test/c/exception.sail b/test/c/exception.sail
index 27248021..4e74fcae 100644
--- a/test/c/exception.sail
+++ b/test/c/exception.sail
@@ -5,7 +5,7 @@ val print_int = "print_int" : (string, int) -> unit
union exception = {
Epair : (range(0, 255), range(0, 255)),
- Eunknown,
+ Eunknown : unit,
Estring : string
}
@@ -28,9 +28,9 @@ function main () = {
print(g());
f(); // will throw Estring
throw(Epair(42, 24));
- throw(Eunknown);
+ throw(Eunknown());
} catch {
- Eunknown => print("Caught Eunknown"),
+ Eunknown() => print("Caught Eunknown"),
Epair(x, y) => print("Caught Epair"),
Estring(str) => {
print("Caught Estring");
diff --git a/test/ocaml/string_of_struct/sos.sail b/test/ocaml/string_of_struct/sos.sail
index 6d14dfd7..69a17e6c 100644
--- a/test/ocaml/string_of_struct/sos.sail
+++ b/test/ocaml/string_of_struct/sos.sail
@@ -3,7 +3,7 @@ struct would cause the ocaml backend to generate a bad string_of
function for the struct */
union option ('a : Type) = {
- None,
+ None : unit,
Some : 'a
}
diff --git a/test/ocaml/trycatch/tc.sail b/test/ocaml/trycatch/tc.sail
index b805f3fa..f788305d 100644
--- a/test/ocaml/trycatch/tc.sail
+++ b/test/ocaml/trycatch/tc.sail
@@ -18,6 +18,6 @@ function main () = {
}
}
-union clause exception = Test_other
+union clause exception = Test_other : unit
end exception \ No newline at end of file
diff --git a/test/ocaml/types/types.sail b/test/ocaml/types/types.sail
index a710eb25..d13b527c 100644
--- a/test/ocaml/types/types.sail
+++ b/test/ocaml/types/types.sail
@@ -24,7 +24,7 @@ struct TestStruct = {
register SREG : TestStruct
-union option ('a : Type) = {None, Some : 'a}
+union option ('a : Type) = {None : unit, Some : 'a}
register OREG : option(byte)
@@ -37,8 +37,8 @@ function main () = {
SIGNALREG = High;
print(if SIGNALREG == High then "pass" else "fail");
SREG.field1 = 0b00;
- print(if SREG.field1 == 0b00 then "pass" else "faiL");
+ print(if SREG.field1 == 0b00 then "pass" else "fail");
SREG.field1 = 0b11;
- print(if SREG.field1 == 0b11 then "pass" else "faiL");
+ print(if SREG.field1 == 0b11 then "pass" else "fail");
print("pass")
}
diff --git a/test/typecheck/pass/option_either.sail b/test/typecheck/pass/option_either.sail
index 632b882d..de4458ed 100644
--- a/test/typecheck/pass/option_either.sail
+++ b/test/typecheck/pass/option_either.sail
@@ -1,13 +1,13 @@
default Order inc
-union option ('a : Type) = {None, Some : 'a}
+union option ('a : Type) = {None : unit, Some : 'a}
-function none () -> forall ('a : Type). option('a) = None
+function none () -> forall ('a : Type). option('a) = None()
function some x : 'a -> forall ('a : Type). option('a) = Some(x)
function test x : option('a) -> forall ('a : Type). range(0, 1) = match x {
- None => 0,
+ None() => 0,
Some(y) => 1
}
diff --git a/test/typecheck/pass/pat_completeness.sail b/test/typecheck/pass/pat_completeness.sail
index fd4a7757..6a4036c5 100644
--- a/test/typecheck/pass/pat_completeness.sail
+++ b/test/typecheck/pass/pat_completeness.sail
@@ -1,11 +1,11 @@
-union option ('a : Type) = {None, Some : 'a}
+union option ('a : Type) = {None : unit, Some : 'a}
union ast = {Foo : unit}
-let x : option(ast) = Some(Foo)
+let x : option(ast) = Some(Foo())
let y : unit = match(x) {
- Some(Foo) => (),
+ Some(Foo()) => (),
Some(a) => (),
- None => ()
+ None() => ()
} \ No newline at end of file
diff --git a/test/typecheck/pass/union_infer.sail b/test/typecheck/pass/union_infer.sail
index 15eb5c60..bb422b65 100644
--- a/test/typecheck/pass/union_infer.sail
+++ b/test/typecheck/pass/union_infer.sail
@@ -1,7 +1,7 @@
default Order inc
-union option ('a : Type) = {None, Some : 'a}
+union option ('a : Type) = {None : unit, Some : 'a}
-union Test = {A, B, C}
+union Test = {A : unit, B : unit, C : unit}
-function test () -> option(Test) = Some(C)
+function test () -> option(Test) = Some(C())