mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Reproduce miscompilation in #4685
This commit is contained in:
parent
3399fe10a0
commit
b6a96ebb85
2 changed files with 38 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
procedure Test.0 ():
|
||||
let Test.8 : Str = "";
|
||||
let Test.1 : List Str = Array [Test.8];
|
||||
joinpoint Test.6:
|
||||
let Test.4 : Str = "C";
|
||||
ret Test.4;
|
||||
in
|
||||
joinpoint Test.5:
|
||||
let Test.3 : Str = "B";
|
||||
ret Test.3;
|
||||
in
|
||||
let Test.7 : U64 = lowlevel ListLen Test.1;
|
||||
dec Test.1;
|
||||
switch Test.7:
|
||||
case 0:
|
||||
let Test.2 : Str = "A";
|
||||
ret Test.2;
|
||||
|
||||
case 1:
|
||||
jump Test.5;
|
||||
|
||||
default:
|
||||
jump Test.5;
|
||||
|
|
@ -2120,3 +2120,17 @@ fn toplevel_accessor_fn_thunk() {
|
|||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn list_one_vs_one_spread_issue_4685() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
main = when [""] is
|
||||
[] -> "A"
|
||||
[_] -> "B"
|
||||
[_, ..] -> "C"
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue