Add test for escape_debug
without bounds check.
This commit is contained in:
parent
222adac953
commit
3e374043f3
1 changed files with 14 additions and 0 deletions
14
tests/codegen/char-escape-debug-no-bounds-check.rs
Normal file
14
tests/codegen/char-escape-debug-no-bounds-check.rs
Normal file
|
@ -0,0 +1,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()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue