brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.5 KiB · 3075a2e Raw
113 lines · plain
1; RUN: opt -mtriple x86_64-unknown-windows-msvc -passes=objc-arc -S -o - %s | FileCheck %s2 3; bool g();4; id h();5;6; void f() {7;   id a = nullptr;8;   if (g())9;     a = h();10;   id b = nullptr;11;   g();12; }13 14declare zeroext i1 @"\01?g@@YA_NXZ"() local_unnamed_addr15declare ptr @"\01?h@@YAPEAUobjc_object@@XZ"() local_unnamed_addr16 17declare dllimport void @llvm.objc.release(ptr) local_unnamed_addr18declare dllimport ptr @llvm.objc.retainAutoreleasedReturnValue(ptr returned) local_unnamed_addr19 20declare i32 @__CxxFrameHandler3(...)21 22define void @"\01?f@@YAXXZ"() local_unnamed_addr personality ptr @__CxxFrameHandler3 {23entry:24  %call = invoke zeroext i1 @"\01?g@@YA_NXZ"()25          to label %invoke.cont unwind label %ehcleanup626 27invoke.cont:                                      ; preds = %entry28  br i1 %call, label %if.then, label %if.end29 30if.then:                                          ; preds = %invoke.cont31  %call2 = invoke ptr @"\01?h@@YAPEAUobjc_object@@XZ"()32          to label %invoke.cont1 unwind label %ehcleanup633 34invoke.cont1:                                     ; preds = %if.then35  %0 = tail call ptr @llvm.objc.retainAutoreleasedReturnValue(ptr %call2)36  tail call void @llvm.objc.release(ptr null), !clang.imprecise_release !137  br label %if.end38 39if.end:                                           ; preds = %invoke.cont1, %invoke.cont40  %a.0 = phi ptr [ %call2, %invoke.cont1 ], [ null, %invoke.cont ]41  %call4 = invoke zeroext i1 @"\01?g@@YA_NXZ"()42          to label %invoke.cont3 unwind label %ehcleanup43 44invoke.cont3:                                     ; preds = %if.end45  tail call void @llvm.objc.release(ptr null), !clang.imprecise_release !146  tail call void @llvm.objc.release(ptr %a.0), !clang.imprecise_release !147  ret void48 49ehcleanup:                                        ; preds = %if.end50  %1 = cleanuppad within none []51  call void @llvm.objc.release(ptr null) [ "funclet"(token %1) ], !clang.imprecise_release !152  cleanupret from %1 unwind label %ehcleanup653 54ehcleanup6:                                       ; preds = %ehcleanup, %if.then, %entry55  %a.1 = phi ptr [ %a.0, %ehcleanup ], [ null, %if.then ], [ null, %entry ]56  %2 = cleanuppad within none []57  call void @llvm.objc.release(ptr %a.1) [ "funclet"(token %2) ], !clang.imprecise_release !158  cleanupret from %2 unwind to caller59}60 61; CHECK-LABEL: ?f@@YAXXZ62; CHECK: call void @llvm.objc.release(ptr {{.*}}) {{.*}}[ "funclet"(token %1) ]63; CHECK-NOT: call void @llvm.objc.release(ptr {{.*}}) {{.*}}[ "funclet"(token %2) ]64 65define void @"\01?i@@YAXXZ"() local_unnamed_addr personality ptr @__CxxFrameHandler3 {66entry:67  %call = invoke zeroext i1 @"\01?g@@YA_NXZ"()68          to label %invoke.cont unwind label %ehcleanup669 70invoke.cont:                                      ; preds = %entry71  br i1 %call, label %if.then, label %if.end72 73if.then:                                          ; preds = %invoke.cont74  %call2 = invoke ptr @"\01?h@@YAPEAUobjc_object@@XZ"()75          to label %invoke.cont1 unwind label %ehcleanup676 77invoke.cont1:                                     ; preds = %if.then78  %0 = tail call ptr @llvm.objc.retainAutoreleasedReturnValue(ptr %call2)79  tail call void @llvm.objc.release(ptr null), !clang.imprecise_release !180  br label %if.end81 82if.end:                                           ; preds = %invoke.cont1, %invoke.cont83  %a.0 = phi ptr [ %call2, %invoke.cont1 ], [ null, %invoke.cont ]84  %call4 = invoke zeroext i1 @"\01?g@@YA_NXZ"()85          to label %invoke.cont3 unwind label %ehcleanup86 87invoke.cont3:                                     ; preds = %if.end88  tail call void @llvm.objc.release(ptr null), !clang.imprecise_release !189  tail call void @llvm.objc.release(ptr %a.0), !clang.imprecise_release !190  ret void91 92ehcleanup:                                        ; preds = %if.end93  %1 = cleanuppad within none []94  call void @llvm.objc.release(ptr null) [ "funclet"(token %1) ], !clang.imprecise_release !195  br label %ehcleanup.196 97ehcleanup.1:98  cleanupret from %1 unwind label %ehcleanup699 100ehcleanup6:                                       ; preds = %ehcleanup, %if.then, %entry101  %a.1 = phi ptr [ %a.0, %ehcleanup.1 ], [ null, %if.then ], [ null, %entry ]102  %2 = cleanuppad within none []103  call void @llvm.objc.release(ptr %a.1) [ "funclet"(token %2) ], !clang.imprecise_release !1104  cleanupret from %2 unwind to caller105}106 107; CHECK-LABEL: ?i@@YAXXZ108; CHECK: call void @llvm.objc.release(ptr {{.*}}) {{.*}}[ "funclet"(token %1) ]109; CHECK-NOT: call void @llvm.objc.release(ptr {{.*}}) {{.*}}[ "funclet"(token %2) ]110 111!1 = !{}112 113