From a3de0c3913d9dec549ebf96496dbf340fa7b124e Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Mon, 5 Nov 2018 17:05:58 +0000 Subject: Add a regression test for issue #22 --- test/c/cheri_capstruct_order.expect | 1 + test/c/cheri_capstruct_order.sail | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/c/cheri_capstruct_order.expect create mode 100644 test/c/cheri_capstruct_order.sail diff --git a/test/c/cheri_capstruct_order.expect b/test/c/cheri_capstruct_order.expect new file mode 100644 index 00000000..9766475a --- /dev/null +++ b/test/c/cheri_capstruct_order.expect @@ -0,0 +1 @@ +ok diff --git a/test/c/cheri_capstruct_order.sail b/test/c/cheri_capstruct_order.sail new file mode 100644 index 00000000..6eb774dd --- /dev/null +++ b/test/c/cheri_capstruct_order.sail @@ -0,0 +1,32 @@ +default Order dec + +val SignalException : unit -> unit effect {rreg} + +val SignalExceptionBadAddr : unit -> unit effect {rreg} + +function SignalExceptionBadAddr() = { + SignalException(); +} + +struct CapStruct = { + base : bool, +} + +type CapReg = CapStruct + +function getCapBase(c) : CapStruct -> bool = c.base + +register KCC : CapReg + +function SignalException () = { + base = getCapBase(KCC); + (); +} + +val "print_endline" : string -> unit + +val main : unit -> unit + +function main() = { + print_endline("ok") +} \ No newline at end of file -- cgit v1.2.3