-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix coverage for matches containing a single case.
The C backend tries not to emit branch coverage points for matches containing a single case but was still emitting a line in all_branches. This confused sailcov and resulting in warnings and weird output. Hopefully fixes #502. Also adds a test case containing a tuple deconstruction (which apparently gets compiled to a single case match).
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>let</title></head> | ||
<body> | ||
<h1>let.sail (3/4) 75%</h1> | ||
<code style="display: block"> | ||
default Order dec<br> | ||
$include <prelude.sail><br> | ||
<br> | ||
register R : bool = true<br> | ||
val main : unit -> unit<br> | ||
<br> | ||
function main() = <span style="background-color: hsl(120, 85%, 80%)">{<br> | ||
let (x, y) = (R, R);<br> | ||
<span style="background-color: hsl(120, 85%, 75%)">if x then <span style="background-color: hsl(120, 85%, 70%)">{<br> | ||
print_endline("A")<br> | ||
}</span> else <span style="background-color: hsl(0, 85%, 80%)">{<br> | ||
print_endline("B")<br> | ||
}</span></span><br> | ||
}</span><br> | ||
</code> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
default Order dec | ||
$include <prelude.sail> | ||
|
||
register R : bool = true | ||
val main : unit -> unit | ||
|
||
function main() = { | ||
let (x, y) = (R, R); | ||
if x then { | ||
print_endline("A") | ||
} else { | ||
print_endline("B") | ||
} | ||
} |