95 lines · plain
1; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s --check-prefix=X86_642; RUN: llc -mtriple=i386-unknown-unknown < %s | FileCheck %s --check-prefix=X863; RUN: llc -mtriple i386-windows-gnu -exception-model sjlj -verify-machineinstrs=0 < %s | FileCheck %s --check-prefix=SJLJ4; RUN: llc -mtriple i386-windows-gnu -exception-model sjlj -verify-machineinstrs=0 < %s | FileCheck %s --check-prefix=NUM5 6; X86_64: test_eh: # @test_eh7; X86_64-NEXT: .Lfunc_begin0:8; X86_64: # %bb.0: # %entry9; X86_64-NEXT: endbr6410; X86_64-NEXT: pushq %rax11; X86_64: .Ltmp0:12; X86_64-NEXT: callq _Z20function_that_throwsv13; X86_64-NEXT: .Ltmp1:14; X86_64-NEXT: # %bb.1: # %try.cont15; X86_64: retq16; X86_64-NEXT: .LBB0_2: # %lpad17; X86_64-NEXT: .cfi_def_cfa_offset 1618; X86_64-NEXT: .Ltmp2:19; X86_64-NEXT: endbr6420; X86_64: callq __cxa_begin_catch21 22 23; X86: test_eh: # @test_eh24; X86-NEXT: .Lfunc_begin0:25; X86: # %bb.0: # %entry26; X86-NEXT: endbr3227; X86-NEXT: .Ltmp0:28; X86: calll _Z20function_that_throwsv29; X86-NEXT: .Ltmp1:30; X86-NEXT: # %bb.1: # %try.cont31; X86-NEXT: retl32; X86-NEXT: .LBB0_2: # %lpad33; X86-NEXT: .Ltmp2:34; X86-NEXT: endbr3235; X86: calll __cxa_begin_catch36 37; NUM-COUNT-3: endbr3238 39; SJLJ: test_eh:40; SJLJ-NEXT: Lfunc_begin0:41; SJLJ-NEXT: # %bb.0: # %entry42; SJLJ-NEXT: endbr3243; SJLJ: calll __Unwind_SjLj_Register44; SJLJ: Ltmp0:45; SJLJ: calll __Z20function_that_throwsv46; SJLJ: LBB0_2: # %try.cont47; SJLJ: calll __Unwind_SjLj_Unregister48; SJLJ: retl49 50; SJLJ: LBB0_3:51; SJLJ-NEXT: endbr3252; SJLJ-NEXT: leal53; SJLJ-NEXT: movl54; SJLJ-NEXT: cmpl55; SJLJ-NEXT: jb LBB0_456 57; SJLJ: LBB0_4:58; SJLJ-NEXT: jmpl *LJTI0_0(,%eax,4)59 60; SJLJ: LBB0_6: # %lpad61; SJLJ-NEXT: Ltmp2:62; SJLJ-NEXT: endbr3263; SJLJ: calll ___cxa_begin_catch64; SJLJ: jmp LBB0_265; SJLJ: LJTI0_0:66; SJLJ-NEXT: .long LBB0_667 68 69 70declare void @_Z20function_that_throwsv()71declare i32 @__gxx_personality_sj0(...)72declare ptr @__cxa_begin_catch(ptr)73declare void @__cxa_end_catch()74 75define void @test_eh() personality ptr @__gxx_personality_sj0 {76entry:77 invoke void @_Z20function_that_throwsv()78 to label %try.cont unwind label %lpad79 80lpad:81 %0 = landingpad { ptr, i32 }82 catch ptr null83 %1 = extractvalue { ptr, i32 } %0, 084 %2 = tail call ptr @__cxa_begin_catch(ptr %1)85 tail call void @__cxa_end_catch()86 br label %try.cont87 88try.cont:89 ret void90}91 92!llvm.module.flags = !{!0}93 94!0 = !{i32 8, !"cf-protection-branch", i32 1}95