summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs')
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs
new file mode 100644
index 000000000..b4173f3b6
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs
@@ -0,0 +1,18 @@
+// only-x86
+// only-windows
+// compile-flags: --crate-type lib --emit link
+#![allow(clashing_extern_declarations)]
+#[link(name = "foo", kind = "raw-dylib")]
+extern "C" {
+ fn f(x: i32);
+}
+
+pub fn lib_main() {
+ #[link(name = "foo", kind = "raw-dylib")]
+ extern "stdcall" {
+ fn f(x: i32);
+ //~^ ERROR multiple declarations of external function `f` from library `foo.dll` have different calling conventions
+ }
+
+ unsafe { f(42); }
+}