Skip to content

Commit

Permalink
Apply merge-functions=disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
  • Loading branch information
JohnTitor committed Jan 7, 2023
1 parent 78e11a4 commit ab9313e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/test/codegen/issue-86106.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
// min-llvm-version: 15.0
// compile-flags: -C opt-level=3
// compile-flags: -C opt-level=3 -Z merge-functions=disabled

// The below two functions ensure that both `String::new()` and `"".to_string()`
// produce the identical code.

#![crate_type = "lib"]

// CHECK-LABEL: @string_new = unnamed_addr alias void (ptr), ptr @empty_to_string
// CHECK-LABEL: define void @string_new
#[no_mangle]
pub fn string_new() -> String {
// CHECK-NOT: load i8
// CHECK: store i{{32|64}}
// CHECK-NEXT: getelementptr
// CHECK-NEXT: store ptr
// CHECK-NEXT: getelementptr
// CHECK-NEXT: store i{{32|64}}
// CHECK-NEXT: ret void
String::new()
}

Expand Down

0 comments on commit ab9313e

Please sign in to comment.