Ensure that statics are always ByRef

This commit is contained in:
Oliver Schneider 2018-05-12 18:47:20 +02:00 committed by Oliver Schneider
parent c95e1cccc9
commit 8b99c61701
3 changed files with 69 additions and 133 deletions

View file

@ -12,11 +12,17 @@
#![crate_type = "lib"]
// CHECK: @VAR1 = constant i32 1, section ".test_one"
// CHECK: @VAR1 = constant <{ [4 x i8] }> <{ [4 x i8] c"\01\00\00\00" }>, section ".test_one"
#[no_mangle]
#[link_section = ".test_one"]
#[cfg(target_endian = "little")]
pub static VAR1: u32 = 1;
#[no_mangle]
#[link_section = ".test_one"]
#[cfg(target_endian = "big")]
pub static VAR1: u32 = 0x01000000;
pub enum E {
A(u32),
B(f32)