mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add FileCheck to calls.rs
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// skip-filecheck
|
||||
// Check that CopyProp does propagate return values of call terminators.
|
||||
//@ test-mir-pass: CopyProp
|
||||
//@ needs-unwind
|
||||
@@ -13,6 +12,13 @@ fn dummy(x: u8) -> u8 {
|
||||
|
||||
// EMIT_MIR calls.nrvo.CopyProp.diff
|
||||
fn nrvo() -> u8 {
|
||||
// CHECK-LABEL: fn nrvo(
|
||||
// CHECK: debug y => _0;
|
||||
// CHECK-NOT: StorageLive(_1);
|
||||
// CHECK-NOT: _1 = dummy(const 5_u8)
|
||||
// CHECK: _0 = dummy(const 5_u8)
|
||||
// CHECK-NOT: _0 = copy _1;
|
||||
// CHECK-NOT: StorageDead(_1);
|
||||
let y = dummy(5); // this should get NRVO
|
||||
y
|
||||
}
|
||||
@@ -20,6 +26,11 @@ fn nrvo() -> u8 {
|
||||
// EMIT_MIR calls.multiple_edges.CopyProp.diff
|
||||
#[custom_mir(dialect = "runtime", phase = "initial")]
|
||||
fn multiple_edges(t: bool) -> u8 {
|
||||
// CHECK-LABEL: fn multiple_edges(
|
||||
// CHECK: bb1: {
|
||||
// CHECK: _2 = dummy(const 13_u8)
|
||||
// CHECK: bb2: {
|
||||
// CHECK: _0 = copy _2;
|
||||
mir! {
|
||||
let x: u8;
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user