#![recursion_limit = "90"]
#![cfg_attr(linktime_used_linker, feature(used_with_arg))]
use dtor::dtor;
use libc_print::*;
#[dtor(unsafe)]
fn dtor() {
libc_eprintln!("dtor");
}
#[dtor(unsafe, method = at_module_exit)]
#[allow(unsafe_code)]
fn dtor_at_module_exit() {
libc_eprintln!("at_module_exit");
}
#[cfg(not(target_vendor = "pc"))] #[dtor(method = at_binary_exit)]
#[allow(unsafe_code)]
unsafe fn dtor_at_binary_exit() {
libc_eprintln!("at_binary_exit");
}
#[cfg_attr(not(target_vendor = "apple"), dtor(unsafe, method = linker, link_section = ".manual.dtor"))]
#[cfg_attr(target_vendor = "apple", dtor(unsafe, method = linker, link_section = "__DATA,__manual_dtors"))]
fn dtor_link_section() {
libc_eprintln!("link_section");
}
#[cfg_attr(not(target_vendor = "apple"), dtor(unsafe, method = linker, link_section = ".dtors", crate_path = ::dtor))]
#[cfg_attr(target_vendor = "apple", dtor(unsafe, method = linker, link_section = "__DATA,__manual_dtors", crate_path = ::dtor))]
fn bar() {
println!("foo");
}
pub fn main() {
use libc_print::*;
libc_eprintln!("main!");
}