mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
fix codegen test
This commit is contained in:
parent
1a51ec6864
commit
67a835d755
@ -1,4 +1,5 @@
|
||||
// compile-flags: -O
|
||||
// min-llvm-version: 16.0
|
||||
#![crate_type = "lib"]
|
||||
|
||||
pub fn foo(t: &mut Vec<usize>) {
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user