diff options
Diffstat (limited to 'tests/ui/generics/generic-extern-mangle.rs')
-rw-r--r-- | tests/ui/generics/generic-extern-mangle.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/generics/generic-extern-mangle.rs b/tests/ui/generics/generic-extern-mangle.rs new file mode 100644 index 000000000..985a6f39c --- /dev/null +++ b/tests/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)); +} |