Skip to content

Commit

Permalink
fix codegen test
Browse files Browse the repository at this point in the history
  • Loading branch information
the8472 committed Apr 28, 2023
1 parent 1a51ec6 commit 67a835d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/codegen/issues/issue-103840.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// compile-flags: -O
// min-llvm-version: 16.0
#![crate_type = "lib"]

pub fn foo(t: &mut Vec<usize>) {
Expand Down
3 changes: 2 additions & 1 deletion tests/codegen/issues/issue-105386-ub-in-debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions tests/codegen/issues/issue-86106.rs
Original file line number Diff line number Diff line change
@@ -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()`
Expand All @@ -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()
}
Expand Down

0 comments on commit 67a835d

Please sign in to comment.