2020-11-16 18:00:00 -06:00
|
|
|
// Checks that closures, constructors, and shims except
|
|
|
|
// for a drop glue receive inline hint by default.
|
|
|
|
//
|
2023-03-16 21:18:28 -05:00
|
|
|
// compile-flags: -Cno-prepopulate-passes -Csymbol-mangling-version=v0 -Zinline-mir=no
|
2020-11-16 18:00:00 -06:00
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
pub fn f() {
|
|
|
|
let a = A;
|
2022-02-23 01:19:57 -06:00
|
|
|
let b = (0i32, 1i32, 2i32, 3 as *const i32);
|
2020-11-16 18:00:00 -06:00
|
|
|
let c = || {};
|
|
|
|
|
|
|
|
a(String::new(), String::new());
|
|
|
|
b.clone();
|
|
|
|
c();
|
|
|
|
}
|
|
|
|
|
|
|
|
struct A(String, String);
|
|
|
|
|
|
|
|
// CHECK: ; core::ptr::drop_in_place::<inline_hint::A>
|
|
|
|
// CHECK-NEXT: ; Function Attrs:
|
|
|
|
// CHECK-NOT: inlinehint
|
|
|
|
// CHECK-SAME: {{$}}
|
|
|
|
|
2022-02-23 01:19:57 -06:00
|
|
|
// CHECK: ; <(i32, i32, i32, *const i{{16|32|64}}) as core::clone::Clone>::clone
|
2020-11-16 18:00:00 -06:00
|
|
|
// CHECK-NEXT: ; Function Attrs: inlinehint
|
|
|
|
|
|
|
|
// CHECK: ; inline_hint::f::{closure#0}
|
|
|
|
// CHECK-NEXT: ; Function Attrs: inlinehint
|
|
|
|
|
|
|
|
// CHECK: ; inline_hint::A
|
|
|
|
// CHECK-NEXT: ; Function Attrs: inlinehint
|