Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for issues #1338 and #1339
Browse files Browse the repository at this point in the history
lukaszcz committed Jul 19, 2022
1 parent 6d26a91 commit 40cf024
Showing 7 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/BackendC/Positive.hs
Original file line number Diff line number Diff line change
@@ -40,6 +40,8 @@ tests =
[ PosTest "HelloWorld" "HelloWorld" StdlibExclude,
PosTest "Inductive types and pattern matching" "Nat" StdlibExclude,
PosTest "Polymorphic types" "Polymorphism" StdlibExclude,
PosTest "Polymorphic axioms" "PolymorphicAxioms" StdlibExclude,
PosTest "Polymorphic target" "PolymorphicTarget" StdlibExclude,
PosTest "Multiple modules" "MultiModules" StdlibExclude,
PosTest "Higher Order Functions" "HigherOrder" StdlibExclude,
PosTest "Higher Order Functions and explicit holes" "PolymorphismHoles" StdlibExclude,
26 changes: 26 additions & 0 deletions tests/positive/MiniC/PolymorphicAxioms/Input.juvix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module Input;

inductive Unit {
unit : Unit;
};

axiom Action : Type;

compile Action {
c ↦ "int";
};

axiom ignore : {A : Type} -> A -> Action;

compile ignore {
c ↦ "ignore";
};

foreign c {
static int ignore(uintptr_t ptr) { return 0; \}
};

main : Action;
main := ignore unit;

end;
Empty file.
Empty file.
26 changes: 26 additions & 0 deletions tests/positive/MiniC/PolymorphicTarget/Input.juvix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module Input;

inductive Unit {
unit : Unit;
};

terminating
loop : {A : Type} -> A;
loop := loop;

const : {A : Type} -> A -> A -> A;
const x y := x;

fail : Unit;
fail := const unit loop;

axiom Action : Type;

compile Action {
c ↦ "int";
};

main : Action;
main := 0;

end;
Empty file.
Empty file.

0 comments on commit 40cf024

Please sign in to comment.