about summary refs log tree commit diff
path: root/tests/codegen-llvm/string-push.rs
blob: cf5f6bb1aa3999835addc60faa453b7b6f6f8b35 (plain)
1
2
3
4
5
6
7
8
9
10
11
//! Check that `String::push` is optimized enough not to call `memcpy`.

//@ compile-flags: -O
#![crate_type = "lib"]

// CHECK-LABEL: @string_push_does_not_call_memcpy
#[no_mangle]
pub fn string_push_does_not_call_memcpy(s: &mut String, ch: char) {
    // CHECK-NOT: call void @llvm.memcpy
    s.push(ch);
}