Home | History | Annotate | Download | only in X86
      1 ; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s --check-prefix=X64
      2 ; RUN: sed -e 's/__C_specific_handler/_except_handler3/' %s | \
      3 ; RUN:        llc -mtriple=i686-windows-msvc | FileCheck %s --check-prefix=X86
      4 
      5 @str_recovered = internal unnamed_addr constant [10 x i8] c"recovered\00", align 1
      6 
      7 declare void @crash()
      8 
      9 define i32 @main() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
     10 entry:
     11   invoke void @crash()
     12           to label %invoke.cont unwind label %lpad
     13 
     14 invoke.cont:                                      ; preds = %entry
     15   %call = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str_recovered, i64 0, i64 0))
     16   call void @abort()
     17   ret i32 0
     18 
     19 lpad:                                             ; preds = %entry
     20   %p = cleanuppad within none []
     21   %call2 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str_recovered, i64 0, i64 0)) [ "funclet"(token %p) ]
     22   cleanupret from %p unwind to caller
     23 }
     24 
     25 ; X64-LABEL: main:
     26 ; X64: retq
     27 
     28 ; X64: .seh_handlerdata
     29 ; X64-NEXT: .Lmain$parent_frame_offset = 32
     30 ; X64-NEXT: .long   (.Llsda_end0-.Llsda_begin0)/16
     31 ; X64-NEXT: .Llsda_begin0:
     32 ; X64-NEXT: .long   .Ltmp0@IMGREL+1
     33 ; X64-NEXT: .long   .Ltmp1@IMGREL+1
     34 ; X64-NEXT: .long   "?dtor$2@?0?main@4HA"@IMGREL
     35 ; X64-NEXT: .long   0
     36 ; X64-NEXT: .Llsda_end0:
     37 
     38 ; X64-LABEL: "?dtor$2@?0?main@4HA":
     39 ; X64: callq puts
     40 ; X64: retq
     41 
     42 ; X86-LABEL: _main:
     43 ; X86: retl
     44 
     45 ; X86-LABEL: "?dtor$2@?0?main@4HA":
     46 ; X86: LBB0_2:
     47 ; X86: calll _puts
     48 ; X86: retl
     49 
     50 ; X86: .section .xdata,"dr"
     51 ; X86: L__ehtable$main:
     52 ; X86-NEXT: .long -1
     53 ; X86-NEXT: .long 0
     54 ; X86-NEXT: .long LBB0_2
     55 
     56 declare i32 @__C_specific_handler(...)
     57 
     58 declare i32 @puts(i8*)
     59 
     60 declare void @abort()
     61