summaryrefslogtreecommitdiffstats
path: root/src/test/codegen/ffi-pure.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/codegen/ffi-pure.rs')
-rw-r--r--src/test/codegen/ffi-pure.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/codegen/ffi-pure.rs b/src/test/codegen/ffi-pure.rs
new file mode 100644
index 000000000..5bdb2ee91
--- /dev/null
+++ b/src/test/codegen/ffi-pure.rs
@@ -0,0 +1,12 @@
+// compile-flags: -C no-prepopulate-passes
+#![crate_type = "lib"]
+#![feature(ffi_pure)]
+
+pub fn bar() { unsafe { foo() } }
+
+extern "C" {
+ // CHECK-LABEL: declare{{.*}}void @foo()
+ // CHECK-SAME: [[ATTRS:#[0-9]+]]
+ // CHECK-DAG: attributes [[ATTRS]] = { {{.*}}readonly{{.*}} }
+ #[ffi_pure] pub fn foo();
+}