Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/ObjCARC/contract-catchswitch.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

77 lines
2.3 KiB
LLVM

; RUN: opt -S -passes=objc-arc-contract < %s | FileCheck %s
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686--windows-msvc19.11.0"
%0 = type opaque
declare i32 @__CxxFrameHandler3(...)
declare dllimport void @llvm.objc.release(ptr) local_unnamed_addr
declare dllimport ptr @llvm.objc.retain(ptr returned) local_unnamed_addr
@p = global ptr null, align 4
declare void @f() local_unnamed_addr
define void @g() local_unnamed_addr personality ptr @__CxxFrameHandler3 {
entry:
%tmp = load ptr, ptr @p, align 4
%tmp1 = tail call ptr @llvm.objc.retain(ptr %tmp) #0
; Split the basic block to ensure bitcast ends up in entry.split.
br label %entry.split
entry.split:
invoke void @f()
to label %invoke.cont unwind label %catch.dispatch
; Dummy nested catchswitch to test looping through the dominator tree.
catch.dispatch:
%tmp2 = catchswitch within none [label %catch] unwind label %catch.dispatch1
catch:
%tmp3 = catchpad within %tmp2 [ptr null, i32 64, ptr null]
catchret from %tmp3 to label %invoke.cont
catch.dispatch1:
%tmp4 = catchswitch within none [label %catch1] unwind label %ehcleanup
catch1:
%tmp5 = catchpad within %tmp4 [ptr null, i32 64, ptr null]
catchret from %tmp5 to label %invoke.cont
invoke.cont:
%tmp6 = load ptr, ptr @p, align 4
%tmp7 = tail call ptr @llvm.objc.retain(ptr %tmp6) #0
call void @llvm.objc.release(ptr %tmp) #0, !clang.imprecise_release !0
; Split the basic block to ensure bitcast ends up in invoke.cont.split.
br label %invoke.cont.split
invoke.cont.split:
invoke void @f()
to label %invoke.cont1 unwind label %ehcleanup
invoke.cont1:
ret void
ehcleanup:
%tmp8 = phi ptr [ %tmp, %catch.dispatch1 ], [ %tmp6, %invoke.cont.split ]
%tmp9 = cleanuppad within none []
call void @llvm.objc.release(ptr %tmp8) #0 [ "funclet"(token %tmp9) ]
cleanupret from %tmp9 unwind to caller
}
; CHECK-LABEL: entry.split:
; CHECK-NEXT: invoke void @f()
; CHECK-NEXT: to label %invoke.cont unwind label %catch.dispatch
; CHECK-LABEL: invoke.cont.split:
; CHECK-NEXT: invoke void @f()
; CHECK-NEXT: to label %invoke.cont1 unwind label %ehcleanup
; CHECK-LABEL: ehcleanup:
; CHECK-NEXT: %tmp8 = phi ptr [ %tmp1, %catch.dispatch1 ], [ %tmp7, %invoke.cont.split ]
attributes #0 = { nounwind }
!0 = !{}