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 42a56df commit 9cf92e5Copy full SHA for 9cf92e5
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