mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-31 09:07:21 +00:00
for referenced values, use allocas instead of phi nodes
This commit is contained in:
parent
ee7f1e39c7
commit
c5a74bdc12
3 changed files with 87 additions and 16 deletions
|
@ -4664,3 +4664,40 @@ fn multiple_uses_of_bool_true_tag_union() {
|
|||
bool
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
|
||||
fn issue_6139() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
buggy = \node, seen ->
|
||||
if List.contains seen node then
|
||||
seen
|
||||
else
|
||||
# node = "B"
|
||||
nextNode = stepNode node
|
||||
|
||||
# node = "C"
|
||||
buggy nextNode (List.append seen node)
|
||||
|
||||
stepNode = \node ->
|
||||
when node is
|
||||
"A" -> "B"
|
||||
"B" -> "C"
|
||||
"C" -> "D"
|
||||
"D" -> "A"
|
||||
_ -> crash ""
|
||||
|
||||
buggy "A" []
|
||||
"#
|
||||
),
|
||||
RocList::from_slice(&[
|
||||
RocStr::from("A"),
|
||||
RocStr::from("B"),
|
||||
RocStr::from("C"),
|
||||
RocStr::from("D"),
|
||||
]),
|
||||
RocList<RocStr>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue