Skip to content

Commit 0918568

Browse files
committed
add codegen check for absence of memcpy in String::push
1 parent c0e0d6d commit 0918568

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: tests/codegen/string-push.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ compile-flags: -O
2+
#![crate_type = "lib"]
3+
4+
// CHECK-LABEL: @string_push_does_not_call_memcpy
5+
#[no_mangle]
6+
pub fn string_push_does_not_call_memcpy(s: &mut String, ch: char) {
7+
// CHECK-NOT: call void @llvm.memcpy
8+
s.push(ch);
9+
}

0 commit comments

Comments
 (0)