Skip to content
/ rust Public
forked from rust-lang/rust

Commit e66fcc3

Browse files
authored
Rollup merge of rust-lang#137491 - jieyouxu:mango-less-likely, r=saethlin
Tighten `str-to-string-128690.rs``CHECK{,-NOT}`s to make it less likely to incorrectly fail with symbol name mangling The `invoke` to match on to `CHECK` or `CHECK-NOT` (latest master) looks like ```llvm %_0.i.i.i.i.i.i.i.i.i.i.i.i.i1.i = invoke noundef zeroext i1 ``@"_ZN42_$LT$str$u20$as$u20$core..fmt..Display$GT$3fmt17ha18033e7fb4f14fcE"(ptr`` noalias noundef nonnull readonly align 1 %_3.val.i.i.i.i.i.i.i.i.i.i.i.i.i, i64 noundef %_3.val1.i.i.i.i.i.i.i.i.i.i.i.i.i, ptr noalias noundef nonnull align 8 dereferenceable(64) %formatter.i) to label %bb1.i unwind label %cleanup.i, !noalias !80 ``` in the local `.ll` output. This test incorrectly failed in rust-lang#137483 (comment) due to ``` // CHECK-NOT: {{(call|invoke).*}}fmt ``` matching against the unrelated call ```llvm tail call void ``@_RNvNtCseLfmtnDCoTB_5alloc7raw_vec12handle_error`` ``` It's not pretty by any means, but... r? ``@saethlin``
2 parents 8a8c0e2 + e15ce94 commit e66fcc3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/codegen/issues/str-to-string-128690.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,27 @@
22
#![crate_type = "lib"]
33

44
//! Make sure str::to_string is specialized not to use fmt machinery.
5+
//!
6+
//! Note that the `CHECK-NOT`s here try to match on calls to functions under `core::fmt`.
57
68
// CHECK-LABEL: define {{(dso_local )?}}void @one_ref
79
#[no_mangle]
810
pub fn one_ref(input: &str) -> String {
9-
// CHECK-NOT: {{(call|invoke).*}}fmt
11+
// CHECK-NOT: {{(call|invoke)}}{{.*}}@{{.*}}core{{.*}}fmt{{.*}}
1012
input.to_string()
1113
}
1214

1315
// CHECK-LABEL: define {{(dso_local )?}}void @two_ref
1416
#[no_mangle]
1517
pub fn two_ref(input: &&str) -> String {
16-
// CHECK-NOT: {{(call|invoke).*}}fmt
18+
// CHECK-NOT: {{(call|invoke)}}{{.*}}@{{.*}}core{{.*}}fmt{{.*}}
1719
input.to_string()
1820
}
1921

2022
// CHECK-LABEL: define {{(dso_local )?}}void @thirteen_ref
2123
#[no_mangle]
2224
pub fn thirteen_ref(input: &&&&&&&&&&&&&str) -> String {
23-
// CHECK-NOT: {{(call|invoke).*}}fmt
25+
// CHECK-NOT: {{(call|invoke)}}{{.*}}@{{.*}}core{{.*}}fmt{{.*}}
2426
input.to_string()
2527
}
2628

@@ -31,6 +33,6 @@ pub fn thirteen_ref(input: &&&&&&&&&&&&&str) -> String {
3133
// CHECK-LABEL: define {{(dso_local )?}}void @fourteen_ref
3234
#[no_mangle]
3335
pub fn fourteen_ref(input: &&&&&&&&&&&&&&str) -> String {
34-
// CHECK: {{(call|invoke).*}}fmt
36+
// CHECK: {{(call|invoke)}}{{.*}}@{{.*}}core{{.*}}fmt{{.*}}
3537
input.to_string()
3638
}

0 commit comments

Comments
 (0)