about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-12-13 01:12:13 +0000
committerbors <bors@rust-lang.org>2018-12-13 01:12:13 +0000
commit2f35a1016b0c0cc1132c19875dcd88d7b2825eae (patch)
treefbc2850a9e364278843141b19445aa1ed1a0796c /src/test/codegen
parent0076f58d5333f24f709aa46b4bad760ffb51b9b0 (diff)
parent1091eee65b91a9968f2a0b2f0c7d6e8e27d8d033 (diff)
downloadrust-2f35a1016b0c0cc1132c19875dcd88d7b2825eae.tar.gz
rust-2f35a1016b0c0cc1132c19875dcd88d7b2825eae.zip
Auto merge of #55982 - alexcrichton:panic-extern-abort, r=zackmdavis
rustc: Switch `extern` functions to abort by default on panic

This was intended to land way back in 1.24, but it was backed out due to
breakage which has long since been fixed. An unstable `#[unwind]`
attribute can be used to tweak the behavior here, but this is currently
simply switching rustc's internal default to abort-by-default if an
`extern` function panics, making our codegen sound primarily (as
currently you can produce UB with safe code)

Closes #52652
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/nounwind-extern.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/codegen/nounwind-extern.rs b/src/test/codegen/nounwind-extern.rs
new file mode 100644
index 00000000000..ed07cf1d6b2
--- /dev/null
+++ b/src/test/codegen/nounwind-extern.rs
@@ -0,0 +1,16 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -O
+
+#![crate_type = "lib"]
+
+// CHECK: Function Attrs: norecurse nounwind
+pub extern fn foo() {}