1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // compile-flags: -C no-prepopulate-passes
13 #![crate_type = "lib"]
15 // CHECK-LABEL: @zero_sized_elem
17 pub fn zero_sized_elem() {
18 // CHECK-NOT: br label %slice_loop_header{{.*}}
19 // CHECK-NOT: call void @llvm.memset.p0i8
24 // CHECK-LABEL: @zero_len_array
26 pub fn zero_len_array() {
27 // CHECK-NOT: br label %slice_loop_header{{.*}}
28 // CHECK-NOT: call void @llvm.memset.p0i8
33 // CHECK-LABEL: @byte_array
36 // CHECK: call void @llvm.memset.p0i8.i[[WIDTH:[0-9]+]](i8* {{.*}}, i8 7, i[[WIDTH]] 4
37 // CHECK-NOT: br label %slice_loop_header{{.*}}
43 #[derive(Copy, Clone)]
49 // CHECK-LABEL: @byte_enum_array
51 pub fn byte_enum_array() {
52 // CHECK: call void @llvm.memset.p0i8.i[[WIDTH:[0-9]+]](i8* {{.*}}, i8 {{.*}}, i[[WIDTH]] 4
53 // CHECK-NOT: br label %slice_loop_header{{.*}}
54 let x = [Init::Memset; 4];
58 // CHECK-LABEL: @zeroed_integer_array
60 pub fn zeroed_integer_array() {
61 // CHECK: call void @llvm.memset.p0i8.i[[WIDTH:[0-9]+]](i8* {{.*}}, i8 0, i[[WIDTH]] 16
62 // CHECK-NOT: br label %slice_loop_header{{.*}}
67 // CHECK-LABEL: @nonzero_integer_array
69 pub fn nonzero_integer_array() {
70 // CHECK: br label %slice_loop_header{{.*}}
71 // CHECK-NOT: call void @llvm.memset.p0i8
72 let x = [0x1a_2b_3c_4d_u32; 4];