Skip to content

Commit 59a9073

Browse files
committed
Add test for escape_debug without bounds check.
1 parent 281f7b4 commit 59a9073

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ compile-flags: -Copt-level=3
2+
#![crate_type = "lib"]
3+
4+
use std::char::EscapeDebug;
5+
6+
// Make sure no bounds checks are emitted when escaping a character.
7+
8+
// CHECK-LABEL: @char_escape_debug_no_bounds_check
9+
#[no_mangle]
10+
pub fn char_escape_debug_no_bounds_check(c: char) -> EscapeDebug {
11+
// CHECK-NOT: panic
12+
// CHECK-NOT: panic_bounds_check
13+
c.escape_debug()
14+
}

0 commit comments

Comments
 (0)