]>
Commit | Line | Data |
---|---|---|
1b1a35ee XL |
1 | // compile-flags: -C no-prepopulate-passes |
2 | ||
3 | #![crate_type = "lib"] | |
4 | #![feature(repr_simd)] | |
5 | ||
6 | // Hack to get the correct size for the length part in slices | |
7 | // CHECK: @helper([[USIZE:i[0-9]+]] %_1) | |
8 | #[no_mangle] | |
9 | pub fn helper(_: usize) { | |
10 | } | |
11 | ||
12 | // Check that we correctly generate a GEP for a ZST that is not included in Scalar layout | |
13 | // CHECK-LABEL: @scalar_layout | |
14 | #[no_mangle] | |
15 | pub fn scalar_layout(s: &(u64, ())) { | |
923072b8 | 16 | // CHECK: getelementptr i8, {{.+}}, [[USIZE]] 8 |
1b1a35ee XL |
17 | let x = &s.1; |
18 | &x; // keep variable in an alloca | |
19 | } | |
20 | ||
21 | // Check that we correctly generate a GEP for a ZST that is not included in ScalarPair layout | |
22 | // CHECK-LABEL: @scalarpair_layout | |
23 | #[no_mangle] | |
24 | pub fn scalarpair_layout(s: &(u64, u32, ())) { | |
923072b8 | 25 | // CHECK: getelementptr i8, {{.+}}, [[USIZE]] 12 |
1b1a35ee XL |
26 | let x = &s.2; |
27 | &x; // keep variable in an alloca | |
28 | } | |
29 | ||
30 | #[repr(simd)] | |
31 | pub struct U64x4(u64, u64, u64, u64); | |
32 | ||
33 | // Check that we correctly generate a GEP for a ZST that is not included in Vector layout | |
34 | // CHECK-LABEL: @vector_layout | |
35 | #[no_mangle] | |
36 | pub fn vector_layout(s: &(U64x4, ())) { | |
923072b8 | 37 | // CHECK: getelementptr i8, {{.+}}, [[USIZE]] 32 |
1b1a35ee XL |
38 | let x = &s.1; |
39 | &x; // keep variable in an alloca | |
40 | } |