summaryrefslogtreecommitdiffstats
path: root/src/test/ui/catch-unwind-bang.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/catch-unwind-bang.rs')
-rw-r--r--src/test/ui/catch-unwind-bang.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/catch-unwind-bang.rs b/src/test/ui/catch-unwind-bang.rs
new file mode 100644
index 000000000..b31b5cab5
--- /dev/null
+++ b/src/test/ui/catch-unwind-bang.rs
@@ -0,0 +1,11 @@
+// run-pass
+// needs-unwind
+// ignore-wasm32-bare compiled with panic=abort by default
+
+fn worker() -> ! {
+ panic!()
+}
+
+fn main() {
+ std::panic::catch_unwind(worker).unwrap_err();
+}