Home | History | Annotate | Download | only in X86
      1 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
      2 
      3 ; BranchFolding used to remove our empty landingpad block, which is
      4 ; undesirable.
      5 
      6 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
      7 target triple = "x86_64-pc-windows-msvc18.0.0"
      8 
      9 declare i32 @__C_specific_handler(...)
     10 
     11 declare void @bar()
     12 
     13 define void @foo(i1 %cond) personality i32 (...)* @__C_specific_handler {
     14 entry:
     15   br i1 %cond, label %return, label %try
     16 
     17 try:                                              ; preds = %entry
     18   invoke void @bar()
     19           to label %fallthrough unwind label %dispatch
     20 
     21 dispatch:                                         ; preds = %try
     22   %cs1 = catchswitch within none [label %catch] unwind to caller
     23 
     24 catch:                                            ; preds = %dispatch
     25   %0 = catchpad within %cs1 [i8* null]
     26   catchret from %0 to label %return
     27 
     28 fallthrough:                                      ; preds = %try
     29   unreachable
     30 
     31 return:                                           ; preds = %catch, %entry
     32   ret void
     33 }
     34 
     35 ; CHECK-LABEL: foo: # @foo
     36 ; CHECK: testb $1, %cl
     37 ; CHECK: je .LBB0_[[try:[0-9]+]]
     38 ; CHECK: .LBB0_[[return:[0-9]+]]:
     39 ; CHECK: retq
     40 ; CHECK: .LBB0_[[try]]:
     41 ; CHECK: .Ltmp0:
     42 ; CHECK: callq bar
     43 ; CHECK: .Ltmp1:
     44 ; CHECK: .LBB0_[[catch:[0-9]+]]:
     45 
     46 ; CHECK: .seh_handlerdata
     47 ; CHECK-NEXT: .Lfoo$parent_frame_offset = 32
     48 ; CHECK-NEXT: .long   (.Llsda_end0-.Llsda_begin0)/16
     49 ; CHECK-NEXT: .Llsda_begin0:
     50 ; CHECK-NEXT: .long   .Ltmp0@IMGREL+1
     51 ; CHECK-NEXT: .long   .Ltmp1@IMGREL+1
     52 ; CHECK-NEXT: .long   1
     53 ; CHECK-NEXT: .long   .LBB0_[[catch]]@IMGREL
     54