summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs')
-rw-r--r--tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs b/tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs
new file mode 100644
index 000000000..1a128c87a
--- /dev/null
+++ b/tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs
@@ -0,0 +1,15 @@
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
+
+#[link(name="foo")]
+extern "C" {
+ #[link_name="foo"]
+ #[link_ordinal(42)]
+ //~^ ERROR cannot use `#[link_name]` with `#[link_ordinal]`
+ fn foo();
+ #[link_name="foo"]
+ #[link_ordinal(5)]
+ //~^ ERROR cannot use `#[link_name]` with `#[link_ordinal]`
+ static mut imported_variable: i32;
+}
+
+fn main() {}