about summary refs log tree commit diff
path: root/tests/codegen/vecdeque-nonempty-get-no-panic.rs
blob: 1128b4ed7a442897fd5d08e34fd8f45d9bd642d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Guards against regression for optimization discussed in issue #80836

//@ compile-flags: -O
//@ ignore-debug: the debug assertions get in the way

#![crate_type = "lib"]

use std::collections::VecDeque;

// CHECK-LABEL: @front
// CHECK: ret void
#[no_mangle]
pub fn front(v: VecDeque<usize>) {
    if !v.is_empty() {
        v.get(0).unwrap();
    }
}