about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-09-14 11:05:34 +0000
committerbors <bors@rust-lang.org>2015-09-14 11:05:34 +0000
commit2d4ae52cbdca96d4dd6d5a009e4a5ef87a279df0 (patch)
tree782f1b598d547a1d7b62afe14809b84aa82d11f7 /src/test/codegen
parent664a45976fb5dd433766f73a221435883151d0ee (diff)
parent3ef75d5774cb9a7cf839a69341c620b98fa9c7df (diff)
downloadrust-2d4ae52cbdca96d4dd6d5a009e4a5ef87a279df0.tar.gz
rust-2d4ae52cbdca96d4dd6d5a009e4a5ef87a279df0.zip
Auto merge of #28358 - dotdash:nounwind, r=alexcrichton
This allows to skip the codegen for all the unneeded landing pads, reducing code size across the board by about 2-5%, depending on the crate. Compile times seem to be pretty unaffected though :-/
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/extern-functions.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/codegen/extern-functions.rs b/src/test/codegen/extern-functions.rs
new file mode 100644
index 00000000000..4c30b5ce02f
--- /dev/null
+++ b/src/test/codegen/extern-functions.rs
@@ -0,0 +1,23 @@
+// 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();
+}