Skip to content

Commit 2bab29d

Browse files
committed
Rust: Add local data flow step tests
1 parent 01141cc commit 2bab29d

File tree

1 file changed

+15
-0
lines changed
  • rust/ql/test/library-tests/dataflow/local

1 file changed

+15
-0
lines changed

rust/ql/test/library-tests/dataflow/local/main.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ fn if_expression(cond: bool) -> i64 {
1414
c
1515
}
1616

17+
fn loop_expression() -> i64 {
18+
let a = 1;
19+
let b = loop {
20+
break a;
21+
};
22+
b
23+
}
24+
25+
fn match_expression(a: i64, b: i64, c: Option<i64>) -> i64 {
26+
match c {
27+
Some(_) => a,
28+
None => b,
29+
}
30+
}
31+
1732
fn main() {
1833
variable();
1934
if_expression(true);

0 commit comments

Comments
 (0)