1 // Copyright 2016 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: -O -C no-prepopulate-passes
13 #![crate_type = "lib"]
19 &a; // keep variable in an alloca
21 // CHECK: [[S_a:%[0-9]+]] = bitcast i32* %a to i8*
22 // CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, i8* [[S_a]])
26 &b; // keep variable in an alloca
28 // CHECK: [[S_b:%[0-9]+]] = bitcast { i32, i32 }** %b to i8*
29 // CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, i8* [[S_b]])
31 // CHECK: [[S__4:%[0-9]+]] = bitcast { i32, i32 }* %_4 to i8*
32 // CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, i8* [[S__4]])
34 // CHECK: [[E__4:%[0-9]+]] = bitcast { i32, i32 }* %_4 to i8*
35 // CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, i8* [[E__4]])
37 // CHECK: [[E_b:%[0-9]+]] = bitcast { i32, i32 }** %b to i8*
38 // CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, i8* [[E_b]])
42 &c; // keep variable in an alloca
44 // CHECK: [[S_c:%[0-9]+]] = bitcast i32* %c to i8*
45 // CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, i8* [[S_c]])
47 // CHECK: [[E_c:%[0-9]+]] = bitcast i32* %c to i8*
48 // CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, i8* [[E_c]])
50 // CHECK: [[E_a:%[0-9]+]] = bitcast i32* %a to i8*
51 // CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, i8* [[E_a]])