Skip to content

Commit 7d774c4

Browse files
Update mir-opt tests.
1 parent 55c3b8e commit 7d774c4

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

src/test/mir-opt/copy_propagation.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ fn test(x: u32) -> u32 {
1313
y
1414
}
1515

16-
fn main() { }
16+
fn main() {
17+
// Make sure the function actually gets instantiated.
18+
test(0);
19+
}
1720

1821
// END RUST SOURCE
1922
// START rustc.node4.CopyPropagation.before.mir

src/test/mir-opt/deaggregator_test.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ fn bar(a: usize) -> Baz {
1818
Baz { x: a, y: 0.0, z: false }
1919
}
2020

21-
fn main() {}
21+
fn main() {
22+
// Make sure the function actually gets instantiated.
23+
bar(0);
24+
}
2225

2326
// END RUST SOURCE
2427
// START rustc.node13.Deaggregator.before.mir

src/test/mir-opt/deaggregator_test_enum_2.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ fn test1(x: bool, y: i32) -> Foo {
2323
}
2424
}
2525

26-
fn main() {}
26+
fn main() {
27+
// Make sure the function actually gets instantiated.
28+
test1(false, 0);
29+
}
2730

2831
// END RUST SOURCE
2932
// START rustc.node12.Deaggregator.before.mir

src/test/mir-opt/deaggregator_test_multiple.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ fn test(x: i32) -> [Foo; 2] {
1919
[Foo::A(x), Foo::A(x)]
2020
}
2121

22-
fn main() { }
22+
fn main() {
23+
// Make sure the function actually gets instantiated.
24+
test(0);
25+
}
2326

2427
// END RUST SOURCE
2528
// START rustc.node10.Deaggregator.before.mir

src/test/mir-opt/issue-41110.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ fn main() {
1414
let x = S.other(S.id());
1515
}
1616

17-
pub fn test() {
17+
// no_mangle and extern C to make sure this gets instantiated even in an
18+
// executable.
19+
#[no_mangle]
20+
pub extern "C" fn test() {
1821
let u = S;
1922
let mut v = S;
2023
drop(v);

0 commit comments

Comments
 (0)