diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2017-10-30 18:20:07 +0100 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2017-11-07 08:54:38 +0100 |
| commit | 7d774c4214e94136eca45df1c81f2baeab15e91e (patch) | |
| tree | 4b18415c22ca2ee6d963504e50c05879c6bc69fb | |
| parent | 55c3b8ec66b0dddc49627a426b687c450ae86da5 (diff) | |
| download | rust-7d774c4214e94136eca45df1c81f2baeab15e91e.tar.gz rust-7d774c4214e94136eca45df1c81f2baeab15e91e.zip | |
Update mir-opt tests.
| -rw-r--r-- | src/test/mir-opt/copy_propagation.rs | 5 | ||||
| -rw-r--r-- | src/test/mir-opt/deaggregator_test.rs | 5 | ||||
| -rw-r--r-- | src/test/mir-opt/deaggregator_test_enum_2.rs | 5 | ||||
| -rw-r--r-- | src/test/mir-opt/deaggregator_test_multiple.rs | 5 | ||||
| -rw-r--r-- | src/test/mir-opt/issue-41110.rs | 5 |
5 files changed, 20 insertions, 5 deletions
diff --git a/src/test/mir-opt/copy_propagation.rs b/src/test/mir-opt/copy_propagation.rs index a45e7f21023..69486f46137 100644 --- a/src/test/mir-opt/copy_propagation.rs +++ b/src/test/mir-opt/copy_propagation.rs @@ -13,7 +13,10 @@ fn test(x: u32) -> u32 { y } -fn main() { } +fn main() { + // Make sure the function actually gets instantiated. + test(0); +} // END RUST SOURCE // START rustc.node4.CopyPropagation.before.mir diff --git a/src/test/mir-opt/deaggregator_test.rs b/src/test/mir-opt/deaggregator_test.rs index 9fe17a277a7..f4db00dab59 100644 --- a/src/test/mir-opt/deaggregator_test.rs +++ b/src/test/mir-opt/deaggregator_test.rs @@ -18,7 +18,10 @@ fn bar(a: usize) -> Baz { Baz { x: a, y: 0.0, z: false } } -fn main() {} +fn main() { + // Make sure the function actually gets instantiated. + bar(0); +} // END RUST SOURCE // START rustc.node13.Deaggregator.before.mir diff --git a/src/test/mir-opt/deaggregator_test_enum_2.rs b/src/test/mir-opt/deaggregator_test_enum_2.rs index 2780f11b9e6..8e7207af0c6 100644 --- a/src/test/mir-opt/deaggregator_test_enum_2.rs +++ b/src/test/mir-opt/deaggregator_test_enum_2.rs @@ -23,7 +23,10 @@ fn test1(x: bool, y: i32) -> Foo { } } -fn main() {} +fn main() { + // Make sure the function actually gets instantiated. + test1(false, 0); +} // END RUST SOURCE // START rustc.node12.Deaggregator.before.mir diff --git a/src/test/mir-opt/deaggregator_test_multiple.rs b/src/test/mir-opt/deaggregator_test_multiple.rs index ede3b2e6e29..bc06ab67eaa 100644 --- a/src/test/mir-opt/deaggregator_test_multiple.rs +++ b/src/test/mir-opt/deaggregator_test_multiple.rs @@ -19,7 +19,10 @@ fn test(x: i32) -> [Foo; 2] { [Foo::A(x), Foo::A(x)] } -fn main() { } +fn main() { + // Make sure the function actually gets instantiated. + test(0); +} // END RUST SOURCE // START rustc.node10.Deaggregator.before.mir diff --git a/src/test/mir-opt/issue-41110.rs b/src/test/mir-opt/issue-41110.rs index 384201b7c12..de789e07d9f 100644 --- a/src/test/mir-opt/issue-41110.rs +++ b/src/test/mir-opt/issue-41110.rs @@ -14,7 +14,10 @@ fn main() { let x = S.other(S.id()); } -pub fn test() { +// no_mangle and extern C to make sure this gets instantiated even in an +// executable. +#[no_mangle] +pub extern "C" fn test() { let u = S; let mut v = S; drop(v); |
