From 03cdeda8664f3e1c103fe93290b8bc85957d32a1 Mon Sep 17 00:00:00 2001 From: Justus Adam Date: Fri, 19 Jan 2024 15:14:16 -0500 Subject: [PATCH] Loop problems test case --- crates/flowistry/tests/pdg.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/flowistry/tests/pdg.rs b/crates/flowistry/tests/pdg.rs index 817e75430..18ed18522 100644 --- a/crates/flowistry/tests/pdg.rs +++ b/crates/flowistry/tests/pdg.rs @@ -471,6 +471,24 @@ pdg_test! { (x -> y) } +pdg_test! { + loops, + { + fn main() { + let mut user_data = vec![]; + while user_data.len() < 10 { + let user_data_ref = &mut user_data; + user_data_ref.push(0_u32); + } + let user_data_ref_2 = &mut user_data; + user_data_ref_2.remove(4); + } + }, + (user_data -> user_data_ref), + (user_data_ref -> user_data_ref), + (user_data_ref -> user_data_ref_2) +} + #[test] fn call_filter() { let input = r#"