2018-03-29 16:59:13 -05:00
|
|
|
#![crate_type = "cdylib"]
|
|
|
|
|
|
|
|
#[no_mangle]
|
2018-04-06 16:22:13 -05:00
|
|
|
#[cfg(a)]
|
2018-03-29 16:59:13 -05:00
|
|
|
pub fn foo() {
|
|
|
|
panic!("test");
|
|
|
|
}
|
2018-04-06 16:22:13 -05:00
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
#[cfg(b)]
|
|
|
|
pub fn foo() {
|
|
|
|
panic!("{}", 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
#[cfg(c)]
|
|
|
|
pub fn foo() {
|
|
|
|
panic!("{}", "a");
|
|
|
|
}
|
2018-10-28 10:26:47 -05:00
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
#[cfg(d)]
|
|
|
|
pub fn foo() -> usize {
|
|
|
|
use std::cell::Cell;
|
|
|
|
thread_local!(static A: Cell<Vec<u32>> = Cell::new(Vec::new()));
|
2020-04-21 14:11:32 -05:00
|
|
|
A.try_with(|x| x.take().len()).unwrap_or(0)
|
2018-10-28 10:26:47 -05:00
|
|
|
}
|