about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-02-24 14:15:55 +0000
committerbors <bors@rust-lang.org>2019-02-24 14:15:55 +0000
commit097c04cf433048585dd9e3f63b30e03cc3509e4b (patch)
tree2eede5dc9fa313a4df57e6215f019f5e08028568 /src/test/codegen
parente17c48e2f21eefd59748e364234efc7037a3ec96 (diff)
parent94aa74004efddf0cfb6fe4bb65eee9effbe40ae8 (diff)
downloadrust-097c04cf433048585dd9e3f63b30e03cc3509e4b.tar.gz
rust-097c04cf433048585dd9e3f63b30e03cc3509e4b.zip
Auto merge of #58315 - gnzlbg:returns_twice, r=alexcrichton
Implement unstable ffi_return_twice attribute

This PR implements [RFC2633](https://github.com/rust-lang/rfcs/pull/2633)

r? @eddyb
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/ffi-returns-twice.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/codegen/ffi-returns-twice.rs b/src/test/codegen/ffi-returns-twice.rs
new file mode 100644
index 00000000000..4db328f1cdf
--- /dev/null
+++ b/src/test/codegen/ffi-returns-twice.rs
@@ -0,0 +1,12 @@
+// compile-flags: -C no-prepopulate-passes
+#![crate_type = "lib"]
+#![feature(ffi_returns_twice)]
+
+pub fn bar() { unsafe { foo() } }
+
+extern {
+    // CHECK-LABEL: declare void @foo()
+    // CHECK-SAME: [[ATTRS:#[0-9]+]]
+    // CHECK-DAG: attributes [[ATTRS]] = { {{.*}}returns_twice{{.*}} }
+    #[ffi_returns_twice] pub fn foo();
+}