os-rust/src/test/codegen/export-no-mangle.rs

32 lines
541 B
Rust
Raw Normal View History

// compile-flags: -C no-prepopulate-passes
#![crate_type = "lib"]
mod private {
// CHECK: @FOO =
#[no_mangle]
pub static FOO: u32 = 3;
// CHECK: @BAR =
#[export_name = "BAR"]
static BAR: u32 = 3;
2020-06-09 15:49:59 +01:00
// CHECK: void @a()
#[no_mangle]
2020-06-09 15:49:59 +01:00
pub extern fn a() {}
2020-06-09 15:49:59 +01:00
// CHECK: void @b()
#[export_name = "b"]
extern fn b() {}
2020-06-08 09:54:33 +01:00
2020-06-09 15:49:59 +01:00
// CHECK: void @c()
#[export_name = "c"]
2020-06-08 09:37:11 +01:00
#[inline]
2020-06-09 15:49:59 +01:00
extern fn c() {}
2020-06-09 15:54:34 +01:00
2020-06-09 15:49:59 +01:00
// CHECK: void @d()
#[export_name = "d"]
#[inline(always)]
extern fn d() {}
}