summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generics/generic-extern-mangle.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/generics/generic-extern-mangle.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/generics/generic-extern-mangle.rs b/src/test/ui/generics/generic-extern-mangle.rs
new file mode 100644
index 000000000..985a6f39c
--- /dev/null
+++ b/src/test/ui/generics/generic-extern-mangle.rs
@@ -0,0 +1,9 @@
+// run-pass
+use std::ops::Add;
+
+extern "C" fn foo<T: Add>(a: T, b: T) -> T::Output { a + b }
+
+fn main() {
+ assert_eq!(100u8, foo(0u8, 100u8));
+ assert_eq!(100u16, foo(0u16, 100u16));
+}