mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
10b8ba4ecb
Co-authored-by: DianQK <dianqk@dianqk.net>
20 lines
507 B
Rust
20 lines
507 B
Rust
//@ compile-flags: -Zunsound-mir-opts
|
|
// FIXME: see <https://github.com/rust-lang/rust/issues/132353>
|
|
//@ test-mir-pass: GVN
|
|
//@ compile-flags: -Zmir-enable-passes=+InstSimplify-before-inline
|
|
|
|
// Check if we have transformed the default clone to copy in the specific pipeline.
|
|
|
|
// EMIT_MIR gvn_clone.{impl#0}-clone.GVN.diff
|
|
|
|
// CHECK-LABEL: ::clone(
|
|
// CHECK-NOT: = AllCopy { {{.*}} };
|
|
// CHECK: _0 = copy (*_1);
|
|
// CHECK: return;
|
|
#[derive(Clone)]
|
|
struct AllCopy {
|
|
a: i32,
|
|
b: u64,
|
|
c: [i8; 3],
|
|
}
|