diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/run-make-fulldeps/extern-fn-generic/testcrate.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/extern-fn-generic/testcrate.rs b/src/test/run-make-fulldeps/extern-fn-generic/testcrate.rs new file mode 100644 index 000000000..39f76e59c --- /dev/null +++ b/src/test/run-make-fulldeps/extern-fn-generic/testcrate.rs @@ -0,0 +1,16 @@ +#![crate_type = "lib"] + +#[repr(C)] +pub struct TestStruct<T> { + pub x: u8, + pub y: T, +} + +pub extern "C" fn foo<T>(ts: TestStruct<T>) -> T { + ts.y +} + +#[link(name = "test", kind = "static")] +extern "C" { + pub fn call(c: extern "C" fn(TestStruct<i32>) -> i32) -> i32; +} |