1 // compile-flags: -C no-prepopulate-passes
12 // CHECK-LABEL: @borrow
14 pub fn borrow(x: &i32) -> &i32 {
15 // CHECK: load {{(i32\*, )?}}i32** %x{{.*}}, !nonnull
16 &x; // keep variable in an alloca
22 pub fn _box(x: Box<i32>) -> i32 {
23 // CHECK: load {{(i32\*, )?}}i32** %x{{.*}}, !nonnull
27 // CHECK-LABEL: small_array_alignment
28 // The array is loaded as i32, but its alignment is lower, go with 1 byte to avoid target
29 // dependent alignment
31 pub fn small_array_alignment(x: [i8; 4]) -> [i8; 4] {
32 // CHECK: [[VAR:%[0-9]+]] = load {{(i32, )?}}i32* %{{.*}}, align 1
33 // CHECK: ret i32 [[VAR]]
37 // CHECK-LABEL: small_struct_alignment
38 // The struct is loaded as i32, but its alignment is lower, go with 1 byte to avoid target
39 // dependent alignment
41 pub fn small_struct_alignment(x: Bytes) -> Bytes {
42 // CHECK: [[VAR:%[0-9]+]] = load {{(i32, )?}}i32* %{{.*}}, align 1
43 // CHECK: ret i32 [[VAR]]