Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2a9d710

Browse files
committed
Bless tests
1 parent c5829c2 commit 2a9d710

File tree

82 files changed

+185
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+185
-177
lines changed

src/tools/miri/tests/fail/abort-terminator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![feature(c_unwind)]
22

33
extern "C" fn panic_abort() {
4-
//~^ ERROR: the program aborted
4+
//~^ ERROR: panic in a function that cannot unwind
55
panic!()
66
}
77

src/tools/miri/tests/fail/abort-terminator.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
thread 'main' panicked at 'explicit panic', $DIR/abort-terminator.rs:LL:CC
22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
3-
error: abnormal termination: the program aborted execution
3+
error: abnormal termination: panic in a function that cannot unwind
44
--> $DIR/abort-terminator.rs:LL:CC
55
|
66
LL | / extern "C" fn panic_abort() {
77
LL | |
88
LL | | panic!()
99
LL | | }
10-
| |_^ the program aborted execution
10+
| |_^ panic in a function that cannot unwind
1111
|
1212
= note: inside `panic_abort` at $DIR/abort-terminator.rs:LL:CC
1313
note: inside `main`

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_bad_unwind2.rs:LL:CC
22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
3-
error: abnormal termination: the program aborted execution
3+
error: abnormal termination: panic in a function that cannot unwind
44
--> $DIR/exported_symbol_bad_unwind2.rs:LL:CC
55
|
66
LL | / extern "C-unwind" fn nounwind() {
77
LL | |
88
LL | |
99
LL | | panic!();
1010
LL | | }
11-
| |_^ the program aborted execution
11+
| |_^ panic in a function that cannot unwind
1212
|
1313
= note: inside `nounwind` at $DIR/exported_symbol_bad_unwind2.rs:LL:CC
1414
note: inside `main`

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
thread 'main' panicked at 'explicit panic', $DIR/exported_symbol_bad_unwind2.rs:LL:CC
22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
3-
error: abnormal termination: the program aborted execution
3+
error: abnormal termination: panic in a function that cannot unwind
44
--> $DIR/exported_symbol_bad_unwind2.rs:LL:CC
55
|
66
LL | / extern "C-unwind" fn nounwind() {
77
LL | |
88
LL | |
99
LL | | panic!();
1010
LL | | }
11-
| |_^ the program aborted execution
11+
| |_^ panic in a function that cannot unwind
1212
|
1313
= note: inside `nounwind` at $DIR/exported_symbol_bad_unwind2.rs:LL:CC
1414
note: inside `main`

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#[cfg_attr(any(definition, both), rustc_nounwind)]
55
#[no_mangle]
66
extern "C-unwind" fn nounwind() {
7-
//~[definition]^ ERROR: abnormal termination: the program aborted execution
8-
//~[both]^^ ERROR: abnormal termination: the program aborted execution
7+
//~[definition]^ ERROR: abnormal termination: panic in a function that cannot unwind
8+
//~[both]^^ ERROR: abnormal termination: panic in a function that cannot unwind
99
panic!();
1010
}
1111

tests/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ fn main() -> () {
99
bb0: {
1010
StorageLive(_1); // scope 1 at $DIR/asm_unwind_panic_abort.rs:+2:9: +2:49
1111
_1 = const (); // scope 1 at $DIR/asm_unwind_panic_abort.rs:+2:9: +2:49
12-
asm!("", options(MAY_UNWIND)) -> [return: bb1, unwind: bb2]; // scope 1 at $DIR/asm_unwind_panic_abort.rs:+2:9: +2:49
12+
asm!("", options(MAY_UNWIND)) -> [return: bb1, unwind terminate]; // scope 1 at $DIR/asm_unwind_panic_abort.rs:+2:9: +2:49
1313
}
1414

1515
bb1: {
1616
StorageDead(_1); // scope 1 at $DIR/asm_unwind_panic_abort.rs:+2:48: +2:49
1717
_0 = const (); // scope 1 at $DIR/asm_unwind_panic_abort.rs:+1:5: +3:6
1818
return; // scope 0 at $DIR/asm_unwind_panic_abort.rs:+4:2: +4:2
1919
}
20-
21-
bb2 (cleanup): {
22-
abort; // scope 0 at $DIR/asm_unwind_panic_abort.rs:+0:1: +4:2
23-
}
2420
}

tests/mir-opt/basic_assignment.main.ElaborateDrops.diff

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
bb2 (cleanup): {
4949
_5 = move _6; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
50-
drop(_6) -> bb6; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
50+
drop(_6) -> [return: bb6, unwind terminate]; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
5151
}
5252

5353
bb3: {
@@ -70,16 +70,20 @@
7070
}
7171

7272
bb6 (cleanup): {
73-
drop(_5) -> bb7; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
73+
drop(_5) -> [return: bb7, unwind terminate]; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
7474
}
7575

7676
bb7 (cleanup): {
77-
- drop(_4) -> bb8; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
77+
- drop(_4) -> [return: bb8, unwind terminate]; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
7878
+ goto -> bb8; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
7979
}
8080

8181
bb8 (cleanup): {
8282
resume; // scope 0 at $DIR/basic_assignment.rs:+0:1: +14:2
83+
+ }
84+
+
85+
+ bb9 (cleanup): {
86+
+ unreachable; // scope 0 at $DIR/basic_assignment.rs:+0:1: +14:2
8387
}
8488
}
8589

tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn main() -> () {
5151

5252
bb2 (cleanup): {
5353
_5 = move _6; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
54-
drop(_6) -> bb6; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
54+
drop(_6) -> [return: bb6, unwind terminate]; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
5555
}
5656

5757
bb3: {
@@ -73,11 +73,11 @@ fn main() -> () {
7373
}
7474

7575
bb6 (cleanup): {
76-
drop(_5) -> bb7; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
76+
drop(_5) -> [return: bb7, unwind terminate]; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
7777
}
7878

7979
bb7 (cleanup): {
80-
drop(_4) -> bb8; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
80+
drop(_4) -> [return: bb8, unwind terminate]; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
8181
}
8282

8383
bb8 (cleanup): {

tests/mir-opt/box_expr.main.ElaborateDrops.before.mir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ fn main() -> () {
6363
}
6464

6565
bb6 (cleanup): {
66-
drop(_7) -> bb7; // scope 1 at $DIR/box_expr.rs:+3:11: +3:12
66+
drop(_7) -> [return: bb7, unwind terminate]; // scope 1 at $DIR/box_expr.rs:+3:11: +3:12
6767
}
6868

6969
bb7 (cleanup): {
70-
drop(_1) -> bb9; // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
70+
drop(_1) -> [return: bb9, unwind terminate]; // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
7171
}
7272

7373
bb8 (cleanup): {
74-
drop(_5) -> bb9; // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
74+
drop(_5) -> [return: bb9, unwind terminate]; // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
7575
}
7676

7777
bb9 (cleanup): {

tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
9898
StorageLive(_3); // scope 0 at $DIR/async_await.rs:+1:5: +1:14
9999
StorageLive(_4); // scope 0 at $DIR/async_await.rs:+1:8: +1:14
100100
StorageLive(_5); // scope 0 at $DIR/async_await.rs:+1:5: +1:8
101-
_5 = a() -> bb2; // scope 0 at $DIR/async_await.rs:+1:5: +1:8
101+
_5 = a() -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+1:5: +1:8
102102
// mir::Constant
103103
// + span: $DIR/async_await.rs:15:5: 15:6
104104
// + literal: Const { ty: fn() -> impl Future<Output = ()> {a}, val: Value(<ZST>) }
105105
}
106106

107107
bb2: {
108-
_4 = <impl Future<Output = ()> as IntoFuture>::into_future(move _5) -> bb3; // scope 0 at $DIR/async_await.rs:+1:8: +1:14
108+
_4 = <impl Future<Output = ()> as IntoFuture>::into_future(move _5) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+1:8: +1:14
109109
// mir::Constant
110110
// + span: $DIR/async_await.rs:15:8: 15:14
111111
// + literal: Const { ty: fn(impl Future<Output = ()>) -> <impl Future<Output = ()> as IntoFuture>::IntoFuture {<impl Future<Output = ()> as IntoFuture>::into_future}, val: Value(<ZST>) }
@@ -126,7 +126,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
126126
StorageLive(_12); // scope 2 at $DIR/async_await.rs:+1:8: +1:14
127127
_12 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>); // scope 2 at $DIR/async_await.rs:+1:8: +1:14
128128
_11 = &mut (*_12); // scope 2 at $DIR/async_await.rs:+1:8: +1:14
129-
_10 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _11) -> bb5; // scope 2 at $DIR/async_await.rs:+1:8: +1:14
129+
_10 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _11) -> [return: bb5, unwind unreachable]; // scope 2 at $DIR/async_await.rs:+1:8: +1:14
130130
// mir::Constant
131131
// + span: $DIR/async_await.rs:15:8: 15:14
132132
// + literal: Const { ty: unsafe fn(&mut impl Future<Output = ()>) -> Pin<&mut impl Future<Output = ()>> {Pin::<&mut impl Future<Output = ()>>::new_unchecked}, val: Value(<ZST>) }
@@ -145,7 +145,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
145145
bb6: {
146146
_13 = &mut (*_14); // scope 2 at $DIR/async_await.rs:+1:5: +1:14
147147
StorageDead(_15); // scope 2 at $DIR/async_await.rs:+1:13: +1:14
148-
_9 = <impl Future<Output = ()> as Future>::poll(move _10, move _13) -> bb7; // scope 2 at $DIR/async_await.rs:+1:8: +1:14
148+
_9 = <impl Future<Output = ()> as Future>::poll(move _10, move _13) -> [return: bb7, unwind unreachable]; // scope 2 at $DIR/async_await.rs:+1:8: +1:14
149149
// mir::Constant
150150
// + span: $DIR/async_await.rs:15:8: 15:14
151151
// + literal: Const { ty: for<'a, 'b, 'c> fn(Pin<&'a mut impl Future<Output = ()>>, &'b mut Context<'c>) -> Poll<<impl Future<Output = ()> as Future>::Output> {<impl Future<Output = ()> as Future>::poll}, val: Value(<ZST>) }
@@ -206,14 +206,14 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
206206
StorageDead(_3); // scope 0 at $DIR/async_await.rs:+1:14: +1:15
207207
StorageLive(_21); // scope 0 at $DIR/async_await.rs:+2:8: +2:14
208208
StorageLive(_22); // scope 0 at $DIR/async_await.rs:+2:5: +2:8
209-
_22 = a() -> bb14; // scope 0 at $DIR/async_await.rs:+2:5: +2:8
209+
_22 = a() -> [return: bb14, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+2:5: +2:8
210210
// mir::Constant
211211
// + span: $DIR/async_await.rs:16:5: 16:6
212212
// + literal: Const { ty: fn() -> impl Future<Output = ()> {a}, val: Value(<ZST>) }
213213
}
214214

215215
bb14: {
216-
_21 = <impl Future<Output = ()> as IntoFuture>::into_future(move _22) -> bb15; // scope 0 at $DIR/async_await.rs:+2:8: +2:14
216+
_21 = <impl Future<Output = ()> as IntoFuture>::into_future(move _22) -> [return: bb15, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+2:8: +2:14
217217
// mir::Constant
218218
// + span: $DIR/async_await.rs:16:8: 16:14
219219
// + literal: Const { ty: fn(impl Future<Output = ()>) -> <impl Future<Output = ()> as IntoFuture>::IntoFuture {<impl Future<Output = ()> as IntoFuture>::into_future}, val: Value(<ZST>) }
@@ -234,7 +234,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
234234
StorageLive(_28); // scope 5 at $DIR/async_await.rs:+2:8: +2:14
235235
_28 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>); // scope 5 at $DIR/async_await.rs:+2:8: +2:14
236236
_27 = &mut (*_28); // scope 5 at $DIR/async_await.rs:+2:8: +2:14
237-
_26 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _27) -> bb17; // scope 5 at $DIR/async_await.rs:+2:8: +2:14
237+
_26 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _27) -> [return: bb17, unwind unreachable]; // scope 5 at $DIR/async_await.rs:+2:8: +2:14
238238
// mir::Constant
239239
// + span: $DIR/async_await.rs:16:8: 16:14
240240
// + literal: Const { ty: unsafe fn(&mut impl Future<Output = ()>) -> Pin<&mut impl Future<Output = ()>> {Pin::<&mut impl Future<Output = ()>>::new_unchecked}, val: Value(<ZST>) }
@@ -253,7 +253,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
253253
bb18: {
254254
_29 = &mut (*_30); // scope 5 at $DIR/async_await.rs:+2:5: +2:14
255255
StorageDead(_31); // scope 5 at $DIR/async_await.rs:+2:13: +2:14
256-
_25 = <impl Future<Output = ()> as Future>::poll(move _26, move _29) -> bb19; // scope 5 at $DIR/async_await.rs:+2:8: +2:14
256+
_25 = <impl Future<Output = ()> as Future>::poll(move _26, move _29) -> [return: bb19, unwind unreachable]; // scope 5 at $DIR/async_await.rs:+2:8: +2:14
257257
// mir::Constant
258258
// + span: $DIR/async_await.rs:16:8: 16:14
259259
// + literal: Const { ty: for<'a, 'b, 'c> fn(Pin<&'a mut impl Future<Output = ()>>, &'b mut Context<'c>) -> Poll<<impl Future<Output = ()> as Future>::Output> {<impl Future<Output = ()> as Future>::poll}, val: Value(<ZST>) }

0 commit comments

Comments
 (0)