summary refs log tree commit diff
path: root/tests/codegen/char-escape-debug-no-bounds-check.rs
blob: cfde46045e5a564e39c5371cbe4fc87446523081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]

use std::char::EscapeDebug;

// Make sure no bounds checks are emitted when escaping a character.

// CHECK-LABEL: @char_escape_debug_no_bounds_check
#[no_mangle]
pub fn char_escape_debug_no_bounds_check(c: char) -> EscapeDebug {
    // CHECK-NOT: panic
    // CHECK-NOT: panic_bounds_check
    c.escape_debug()
}