brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · e10fc66 Raw
36 lines · plain
1; RUN: llvm-as -disable-output < %s2 3%"struct.std::pair<int,int>" = type { i32, i32 }4 5declare void @_Z3barRKi(ptr)6 7declare void @llvm.lifetime.start(i64, ptr nocapture) nounwind8declare void @llvm.lifetime.end(i64, ptr nocapture) nounwind9declare ptr @llvm.invariant.start.p0(i64, ptr nocapture) readonly nounwind10declare void @llvm.invariant.end.p0(ptr, i64, ptr nocapture) nounwind11 12define i32 @_Z4foo2v() nounwind {13entry:14  %x = alloca %"struct.std::pair<int,int>"15 16  ;; Constructor starts here (this isn't needed since it is immediately17  ;; preceded by an alloca, but shown for completeness).18  call void @llvm.lifetime.start(i64 8, ptr %x)19 20  %0 = getelementptr %"struct.std::pair<int,int>", ptr %x, i32 0, i32 021  store i32 4, ptr %0, align 822  %1 = getelementptr %"struct.std::pair<int,int>", ptr %x, i32 0, i32 123  store i32 5, ptr %1, align 424 25  ;; Constructor has finished here.26  %inv = call ptr @llvm.invariant.start.p0(i64 8, ptr %x)27  call void @_Z3barRKi(ptr %0) nounwind28  %2 = load i32, ptr %0, align 829 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)34  ret i32 %235}36