summaryrefslogtreecommitdiffstats
path: root/src/test/codegen/slice-iter-len-eq-zero.rs
blob: fd19e624cdddb676391427e522dc9b97137a854c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// no-system-llvm
// compile-flags: -O
#![crate_type = "lib"]

type Demo = [u8; 3];

// CHECK-LABEL: @slice_iter_len_eq_zero
#[no_mangle]
pub fn slice_iter_len_eq_zero(y: std::slice::Iter<'_, Demo>) -> bool {
    // CHECK-NOT: sub
    // CHECK: %2 = icmp eq {{i8\*|ptr}} %1, %0
    // CHECK: ret i1 %2
    y.len() == 0
}