We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a41e2fd commit 355904dCopy full SHA for 355904d
compiler/rustc_data_structures/src/graph/scc/tests.rs
@@ -142,6 +142,32 @@ fn test_find_state_3() {
142
assert_eq!(sccs.successors(1), &[0]);
143
}
144
145
+#[test]
146
+fn test_deep_linear() {
147
+ /*
148
+ 0
149
+ |
150
+ v
151
+ 1
152
153
154
+ 2
155
156
157
+ …
158
+ */
159
+ const NR_NODES: usize = 1 << 14;
160
+ let mut nodes = vec![];
161
+ for i in 1..NR_NODES {
162
+ nodes.push((i - 1, i));
163
+ }
164
+ let graph = TestGraph::new(0, nodes.as_slice());
165
+ let sccs: Sccs<_, usize> = Sccs::new(&graph);
166
+ assert_eq!(sccs.num_sccs(), NR_NODES);
167
+ assert_eq!(sccs.scc(0), NR_NODES - 1);
168
+ assert_eq!(sccs.scc(NR_NODES - 1), 0);
169
+}
170
+
171
#[bench]
172
fn bench_sccc(b: &mut test::Bencher) {
173
// Like `test_three_sccs` but each state is replaced by a group of
0 commit comments