summaryrefslogtreecommitdiffstats
path: root/tests/codegen/ffi-returns-twice.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen/ffi-returns-twice.rs')
-rw-r--r--tests/codegen/ffi-returns-twice.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/codegen/ffi-returns-twice.rs b/tests/codegen/ffi-returns-twice.rs
new file mode 100644
index 000000000..0fbe03f0b
--- /dev/null
+++ b/tests/codegen/ffi-returns-twice.rs
@@ -0,0 +1,11 @@
+// compile-flags: -C no-prepopulate-passes
+#![crate_type = "lib"]
+#![feature(ffi_returns_twice)]
+
+pub fn bar() { unsafe { foo() } }
+
+extern "C" {
+ // CHECK: declare{{( dso_local)?}} void @foo(){{.*}}[[ATTRS:#[0-9]+]]
+ // CHECK: attributes [[ATTRS]] = { {{.*}}returns_twice{{.*}} }
+ #[ffi_returns_twice] pub fn foo();
+}