Skip to content

Commit

Permalink
test bundle rename and rename-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
tahina-pro committed Feb 19, 2025
1 parent fa47096 commit be223e4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions test/rust-val/AuxB.fsti
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module AuxB

val bar : bool -> bool
4 changes: 2 additions & 2 deletions test/rust-val/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ $(CACHE_DIR)/%.checked: | .depend

.PRECIOUS: %.rs
%.rs: $(ALL_KRML_FILES) $(KRML_BIN)
$(KRML) -minimal -bundle $(notdir $(subst rust,Rust,$*))=\* \
$(KRML) -minimal -bundle AuxA+AuxB=[rename=Aux,rename-prefix] -bundle $(notdir $(subst rust,Rust,$*))=\* \
-backend rust $(EXTRA) -tmpdir $(dir $@) $(filter %.krml,$^)
$(SED) -i 's/\(patterns..\)/\1\nmod auxa; mod lowstar { pub mod ignore { pub fn ignore<T>(_x: T) {}}}\n/' $@
$(SED) -i 's/\(patterns..\)/\1\nmod aux; mod lowstar { pub mod ignore { pub fn ignore<T>(_x: T) {}}}\n/' $@
echo 'fn main () { let r = main_ (); if r != 0 { println!("main_ returned: {}\\n", r); panic!() } }' >> $@

%.rust-test: %.rs
Expand Down
4 changes: 3 additions & 1 deletion test/rust-val/Rusttest.fst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ let test2 (b: B.buffer bool) : HST.Stack bool
(fun _ _ _ -> True)
=
let x = B.index b C._zero_for_deref in
AuxA.foo x
let r1 = AuxA.foo x in
let r2 = AuxB.bar x in
r1 && r2

let main_ () : HST.Stack I32.t
(fun _ -> True)
Expand Down
5 changes: 5 additions & 0 deletions test/rust-val/auxa.rs → test/rust-val/aux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ pub fn foo(x: bool) -> bool
{
return !x;
}

pub fn bar(x: bool) -> bool
{
return x;
}

0 comments on commit be223e4

Please sign in to comment.