We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
memcpy
String::push
1 parent c20a27c commit b2a3082Copy full SHA for b2a3082
tests/codegen/string-push.rs
@@ -0,0 +1,11 @@
1
+//! Check that `String::push` is optimized enough not to call `memcpy`.
2
+
3
+//@ compile-flags: -O
4
+#![crate_type = "lib"]
5
6
+// CHECK-LABEL: @string_push_does_not_call_memcpy
7
+#[no_mangle]
8
+pub fn string_push_does_not_call_memcpy(s: &mut String, ch: char) {
9
+ // CHECK-NOT: call void @llvm.memcpy
10
+ s.push(ch);
11
+}
0 commit comments