]> git.lizzy.rs Git - rust.git/blob - tests/codegen/inline-hint.rs
Rollup merge of #107731 - RalfJung:interpret-discriminant, r=cjgillot
[rust.git] / tests / codegen / inline-hint.rs
1 // Checks that closures, constructors, and shims except
2 // for a drop glue receive inline hint by default.
3 //
4 // compile-flags: -Cno-prepopulate-passes -Csymbol-mangling-version=v0
5 #![crate_type = "lib"]
6
7 pub fn f() {
8     let a = A;
9     let b = (0i32, 1i32, 2i32, 3 as *const i32);
10     let c = || {};
11
12     a(String::new(), String::new());
13     b.clone();
14     c();
15 }
16
17 struct A(String, String);
18
19 // CHECK:      ; core::ptr::drop_in_place::<inline_hint::A>
20 // CHECK-NEXT: ; Function Attrs:
21 // CHECK-NOT:  inlinehint
22 // CHECK-SAME: {{$}}
23
24 // CHECK:      ; <(i32, i32, i32, *const i{{16|32|64}}) as core::clone::Clone>::clone
25 // CHECK-NEXT: ; Function Attrs: inlinehint
26
27 // CHECK:      ; inline_hint::f::{closure#0}
28 // CHECK-NEXT: ; Function Attrs: inlinehint
29
30 // CHECK:      ; inline_hint::A
31 // CHECK-NEXT: ; Function Attrs: inlinehint