#![feature(optin_builtin_traits)]
#![feature(reflect)]
#![feature(rustc_attrs)]
+#![feature(unwind_attributes)]
#![cfg_attr(stage0, feature(simd))]
#![cfg_attr(not(stage0), feature(repr_simd, platform_intrinsics))]
#![feature(staged_api)]
#[allow(improper_ctypes)]
extern {
#[lang = "panic_fmt"]
+ #[unwind]
fn panic_impl(fmt: fmt::Arguments, file: &'static str, line: u32) -> !;
}
let (file, line) = *file_line;
let llfn_ty = lltype_for_fn_from_foreign_types(ccx, &tys);
let llfn = get_extern_fn(ccx, &mut *ccx.externs().borrow_mut(), name, cc, llfn_ty, fty);
+ attributes::unwind(llfn, false);
add_argument_attributes(&tys, llfn);
attributes::from_fn_attrs(ccx, attrs, llfn);
llfn
#![feature(unique)]
#![feature(unsafe_no_drop_flag, filling_drop)]
#![feature(decode_utf16)]
+#![feature(unwind_attributes)]
#![feature(vec_push_all)]
#![feature(vec_resize)]
#![feature(wrapping)]
// iOS on armv7 uses SjLj exceptions and requires to link
// against corresponding routine (..._SjLj_...)
#[cfg(not(all(target_os = "ios", target_arch = "arm")))]
+ #[unwind]
pub fn _Unwind_RaiseException(exception: *mut _Unwind_Exception)
-> _Unwind_Reason_Code;
#[cfg(all(target_os = "ios", target_arch = "arm"))]
+ #[unwind]
fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception)
-> _Unwind_Reason_Code;
#[cfg(not(test))]
/// Entry point of panic from the libcore crate.
#[lang = "panic_fmt"]
+#[unwind]
pub extern fn rust_begin_unwind(msg: fmt::Arguments,
file: &'static str, line: u32) -> ! {
begin_unwind_fmt(msg, &(file, line))
// This function is provided by kernel32.dll
extern "system" {
+ #[unwind]
fn RaiseException(dwExceptionCode: DWORD,
dwExceptionFlags: DWORD,
nNumberOfArguments: DWORD,
// From kernel32.dll
extern "system" {
+ #[unwind]
fn RaiseException(dwExceptionCode: DWORD,
dwExceptionFlags: DWORD,
nNumberOfArguments: DWORD,
#[lang = "eh_unwind_resume"]
#[cfg(not(test))]
+#[unwind]
unsafe extern fn rust_eh_unwind_resume(panic_ctx: LPVOID) {
let params = [panic_ctx as ULONG_PTR];
RaiseException(RUST_PANIC,
--- /dev/null
+// Copyright 2015 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: -C no-prepopulate-passes
+
+#![feature(unwind_attributes)]
+
+extern {
+// CHECK: Function Attrs: nounwind
+// CHECK-NEXT: declare void @extern_fn
+ fn extern_fn();
+// CHECK-NOT: Function Attrs: nounwind
+// CHECK: declare void @unwinding_extern_fn
+ #[unwind]
+ fn unwinding_extern_fn();
+}