fix codegen test

This commit is contained in:
The 8472 2023-04-05 21:15:32 +02:00
parent 1a51ec6864
commit 67a835d755
3 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,5 @@
// compile-flags: -O
// min-llvm-version: 16.0
#![crate_type = "lib"]
pub fn foo(t: &mut Vec<usize>) {

View File

@ -19,4 +19,5 @@ pub fn outer_function(x: S, y: S) -> usize {
// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:9:23: 9:25]", ptr [[spill]]
// CHECK-NOT: [[load:%.*]] = load ptr, ptr
// CHECK: call void @llvm.lifetime.start{{.*}}({{.*}}, ptr [[spill]])
// CHECK: call void @llvm.memcpy{{.*}}(ptr {{align .*}} [[spill]], ptr {{align .*}} %x
// CHECK: [[inner:%.*]] = getelementptr inbounds %"{{.*}}", ptr [[spill]]
// CHECK: call void @llvm.memcpy{{.*}}(ptr {{align .*}} [[inner]], ptr {{align .*}} %x

View File

@ -1,4 +1,5 @@
// min-llvm-version: 15.0
// only-64bit llvm appears to use stores instead of memset on 32bit
// compile-flags: -C opt-level=3 -Z merge-functions=disabled
// The below two functions ensure that both `String::new()` and `"".to_string()`
@ -19,9 +20,9 @@ pub fn string_new() -> String {
// CHECK-LABEL: define void @empty_to_string
#[no_mangle]
pub fn empty_to_string() -> String {
// CHECK: getelementptr
// CHECK: store ptr inttoptr
// CHECK-NEXT: getelementptr
// CHECK-NEXT: call void @llvm.memset
// CHECK-NEXT: store ptr inttoptr
// CHECK-NEXT: ret void
"".to_string()
}