about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorGibson Fahnestock <gibfahn@gmail.com>2017-03-05 19:32:46 +0000
committerGibson Fahnestock <gibfahn@gmail.com>2017-03-05 20:17:01 +0000
commitea3f148d3d3b4fb1d1b49be1be4b025fe17dde26 (patch)
treeb49b42cfd1f5ae2d4b21694db4155402d7d1826b /src/test/compile-fail
parent6b76c9ea19f4538a6ace44ebce2b8bfd1f80c126 (diff)
downloadrust-ea3f148d3d3b4fb1d1b49be1be4b025fe17dde26.tar.gz
rust-ea3f148d3d3b4fb1d1b49be1be4b025fe17dde26.zip
Add compile-fail test for unwind_attributes
Test copied from src/test/codegen/extern-functions.rs.

Refs: https://github.com/rust-lang/rust/issues/39059
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/feature-gate-unwind-attributes.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/compile-fail/feature-gate-unwind-attributes.rs b/src/test/compile-fail/feature-gate-unwind-attributes.rs
new file mode 100644
index 00000000000..c8f9cd943cd
--- /dev/null
+++ b/src/test/compile-fail/feature-gate-unwind-attributes.rs
@@ -0,0 +1,28 @@
+// 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
+
+#![crate_type = "lib"]
+
+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] //~ ERROR #[unwind] is experimental
+    fn unwinding_extern_fn();
+}
+
+pub unsafe fn force_declare() {
+    extern_fn();
+    unwinding_extern_fn();
+}