Skip to content

Commit 6908758

Browse files
committed
Add a test case for clone
1 parent a526d7c commit 6908758

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![crate_type = "lib"]
2+
3+
// EMIT_MIR no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir
4+
5+
// CHECK-LABEL: ::clone(
6+
// CHECK: inlined clone::impls::<impl Clone for {{.*}}>::clone
7+
// CHECK: return;
8+
9+
#[derive(Clone)]
10+
struct Foo {
11+
a: i32,
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// MIR for `<impl at $DIR/no_inlined_clone.rs:9:10: 9:15>::clone` after PreCodegen
2+
3+
fn <impl at $DIR/no_inlined_clone.rs:9:10: 9:15>::clone(_1: &Foo) -> Foo {
4+
debug self => _1;
5+
let mut _0: Foo;
6+
let mut _2: i32;
7+
scope 1 (inlined clone::impls::<impl Clone for i32>::clone) {
8+
}
9+
10+
bb0: {
11+
StorageLive(_2);
12+
_2 = ((*_1).0: i32);
13+
_0 = Foo { a: move _2 };
14+
StorageDead(_2);
15+
return;
16+
}
17+
}

0 commit comments

Comments
 (0)