1 ; RUN: llvm-as -disable-output < %s
3 %"struct.std::pair<int,int>" = type { i32, i32 }
5 declare void @_Z3barRKi(ptr)
7 declare void @llvm.lifetime.start(i64, ptr nocapture) nounwind
8 declare void @llvm.lifetime.end(i64, ptr nocapture) nounwind
9 declare ptr @llvm.invariant.start.p0(i64, ptr nocapture) readonly nounwind
10 declare void @llvm.invariant.end.p0(ptr, i64, ptr nocapture) nounwind
12 define i32 @_Z4foo2v() nounwind {
14 %x = alloca %"struct.std::pair<int,int>"
16 ;; Constructor starts here (this isn't needed since it is immediately
17 ;; preceded by an alloca, but shown for completeness).
18 call void @llvm.lifetime.start(i64 8, ptr %x)
20 %0 = getelementptr %"struct.std::pair<int,int>", ptr %x, i32 0, i32 0
21 store i32 4, ptr %0, align 8
22 %1 = getelementptr %"struct.std::pair<int,int>", ptr %x, i32 0, i32 1
23 store i32 5, ptr %1, align 4
25 ;; Constructor has finished here.
26 %inv = call ptr @llvm.invariant.start.p0(i64 8, ptr %x)
27 call void @_Z3barRKi(ptr %0) nounwind
28 %2 = load i32, ptr %0, align 8
30 ;; Destructor is run here.
31 call void @llvm.invariant.end.p0(ptr %inv, i64 8, ptr %x)
32 ;; Destructor is done here.
33 call void @llvm.lifetime.end(i64 8, ptr %x)