From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/mir-opt/lower_array_len.rs | 40 ------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/test/mir-opt/lower_array_len.rs (limited to 'src/test/mir-opt/lower_array_len.rs') diff --git a/src/test/mir-opt/lower_array_len.rs b/src/test/mir-opt/lower_array_len.rs deleted file mode 100644 index ea0224b21..000000000 --- a/src/test/mir-opt/lower_array_len.rs +++ /dev/null @@ -1,40 +0,0 @@ -// unit-test: NormalizeArrayLen -// compile-flags: -Zmir-enable-passes=+LowerSliceLenCalls - -// EMIT_MIR lower_array_len.array_bound.NormalizeArrayLen.diff -pub fn array_bound(index: usize, slice: &[u8; N]) -> u8 { - if index < slice.len() { - slice[index] - } else { - 42 - } -} - -// EMIT_MIR lower_array_len.array_bound_mut.NormalizeArrayLen.diff -pub fn array_bound_mut(index: usize, slice: &mut [u8; N]) -> u8 { - if index < slice.len() { - slice[index] - } else { - slice[0] = 42; - - 42 - } -} - -// EMIT_MIR lower_array_len.array_len.NormalizeArrayLen.diff -pub fn array_len(arr: &[u8; N]) -> usize { - arr.len() -} - -// EMIT_MIR lower_array_len.array_len_by_value.NormalizeArrayLen.diff -pub fn array_len_by_value(arr: [u8; N]) -> usize { - arr.len() -} - -fn main() { - let _ = array_bound(3, &[0, 1, 2, 3]); - let mut tmp = [0, 1, 2, 3, 4]; - let _ = array_bound_mut(3, &mut [0, 1, 2, 3]); - let _ = array_len(&[0]); - let _ = array_len_by_value([0, 2]); -} -- cgit v1.2.3