xref: /llvm-project/llvm/test/CodeGen/X86/sjlj-eh-musttail.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; FIXME: Fix machine verifier issues and remove -verify-machineinstrs=0. PR39439.
2; RUN: llc -mtriple i386-windows-gnu -exception-model sjlj -filetype asm -o - %s -verify-machineinstrs=0 | FileCheck %s
3
4declare void @_Z20function_that_throwsv()
5declare i32 @__gxx_personality_sj0(...)
6declare ptr @__cxa_begin_catch(ptr)
7declare void @__cxa_end_catch()
8declare void @_callee();
9
10define void @_Z8functionv() personality ptr @__gxx_personality_sj0 {
11entry:
12  invoke void @_Z20function_that_throwsv()
13          to label %try.cont unwind label %lpad
14
15lpad:
16  %0 = landingpad { ptr, i32 }
17          catch ptr null
18  %1 = extractvalue { ptr, i32 } %0, 0
19  %2 = tail call ptr @__cxa_begin_catch(ptr %1)
20  tail call void @__cxa_end_catch()
21  br label %try.cont
22
23try.cont:
24  musttail call void @_callee();
25  ret void
26}
27
28; CHECK-LABEL: __Z8functionv:
29; CHECK:         calll   __Unwind_SjLj_Unregister
30; CHECK-NOT:     {{.*}}:
31; CHECK:         jmp     __callee
32