FileCheck combine_clone_of_primitives.

This commit is contained in:
Camille GILLOT 2023-10-16 19:26:04 +00:00
parent 5453a4f056
commit ddc328c2f1
3 changed files with 11 additions and 8 deletions

View File

@ -1,9 +1,7 @@
// skip-filecheck
// unit-test: InstSimplify
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR combine_clone_of_primitives.{impl#0}-clone.InstSimplify.diff
#[derive(Clone)]
struct MyThing<T> {
v: T,
@ -11,6 +9,11 @@ struct MyThing<T> {
a: [f32; 3],
}
// CHECK-LABEL: ::clone(
// CHECK: <T as Clone>::clone(
// CHECK-NOT: <u64 as Clone>::clone(
// CHECK-NOT: <[f32; 3] as Clone>::clone(
fn main() {
let x = MyThing::<i16> { v: 2, i: 3, a: [0.0; 3] };
let y = x.clone();

View File

@ -1,7 +1,7 @@
- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:7:10: 7:15>::clone` before InstSimplify
+ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:7:10: 7:15>::clone` after InstSimplify
- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` before InstSimplify
+ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` after InstSimplify
fn <impl at $DIR/combine_clone_of_primitives.rs:7:10: 7:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
fn <impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
debug self => _1;
let mut _0: MyThing<T>;
let mut _2: T;

View File

@ -1,7 +1,7 @@
- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:7:10: 7:15>::clone` before InstSimplify
+ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:7:10: 7:15>::clone` after InstSimplify
- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` before InstSimplify
+ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` after InstSimplify
fn <impl at $DIR/combine_clone_of_primitives.rs:7:10: 7:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
fn <impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
debug self => _1;
let mut _0: MyThing<T>;
let mut _2: T;