summaryrefslogtreecommitdiffstats
path: root/tests/ui/box/unit/unique-ffi-symbols.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/box/unit/unique-ffi-symbols.rs')
-rw-r--r--tests/ui/box/unit/unique-ffi-symbols.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/box/unit/unique-ffi-symbols.rs b/tests/ui/box/unit/unique-ffi-symbols.rs
new file mode 100644
index 000000000..77b5ead26
--- /dev/null
+++ b/tests/ui/box/unit/unique-ffi-symbols.rs
@@ -0,0 +1,16 @@
+// run-pass
+// We used to have a __rust_abi shim that resulted in duplicated symbols
+// whenever the item path wasn't enough to disambiguate between them.
+fn main() {
+ let a = {
+ extern "C" fn good() -> i32 { return 0; }
+ good as extern "C" fn() -> i32
+ };
+ let b = {
+ extern "C" fn good() -> i32 { return 5; }
+ good as extern "C" fn() -> i32
+ };
+
+ assert!(a != b);
+ assert_eq!((a(), b()), (0, 5));
+}