summaryrefslogtreecommitdiffstats
path: root/tests/run-make/extern-fn-generic/testcrate.rs
blob: 39f76e59ca0c0edcd42b6178f4759319437c7d4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}