diff options
| author | Jon French | 2019-03-14 13:56:37 +0000 |
|---|---|---|
| committer | Jon French | 2019-03-14 13:56:37 +0000 |
| commit | 0d88c148a2a068a95b5fc3d5c25b599faf3e75a0 (patch) | |
| tree | cb507bee25582f503ae4047ce32558352aeb8b27 /test/c/int_struct.sail | |
| parent | 4f14ccb421443dbc10b88e190526dda754f324aa (diff) | |
| parent | ec8cad1daa76fb265014d3d313173905925c9922 (diff) | |
Merge branch 'sail2' into rmem_interpreter
Diffstat (limited to 'test/c/int_struct.sail')
| -rw-r--r-- | test/c/int_struct.sail | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/c/int_struct.sail b/test/c/int_struct.sail new file mode 100644 index 00000000..42554593 --- /dev/null +++ b/test/c/int_struct.sail @@ -0,0 +1,24 @@ +default Order dec + +$include <prelude.sail> + +val print = "print_endline" : string -> unit + +struct Foo('n: Int) = { + field: bits('n) +} + +type Foo32 = Foo(32) + +function bar(foo: Foo32) -> unit = { + if foo.field == 0xFFFF_FFFF then { + print("A") + } else { + print("B") + } +} + +function main((): unit) -> unit = { + let x: Foo32 = struct { field = 0xFFFF_FFFF }; + bar(x) +}
\ No newline at end of file |
