1 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s 2 ; RUN: llc -verify-machineinstrs -O0 < %s | FileCheck %s 3 4 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" 5 target triple = "x86_64-pc-windows-msvc" 6 7 declare void @f(i32) 8 declare i32 @__C_specific_handler(...) 9 declare i32 @llvm.eh.exceptioncode(token) 10 11 define void @ehcode() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) { 12 entry: 13 invoke void @f(i32 0) 14 to label %__try.cont unwind label %catch.dispatch 15 16 catch.dispatch: ; preds = %entry 17 %cs = catchswitch within none [label %__except] unwind to caller 18 19 __except: ; preds = %catch.dispatch 20 %pad = catchpad within %cs [i8* null] 21 catchret from %pad to label %__except.1 22 23 __except.1: ; preds = %__except 24 %code = call i32 @llvm.eh.exceptioncode(token %pad) 25 call void @f(i32 %code) 26 br label %__try.cont 27 28 __try.cont: ; preds = %entry, %__except.1 29 ret void 30 } 31 32 ; CHECK-LABEL: ehcode: 33 ; CHECK: xorl %ecx, %ecx 34 ; CHECK: callq f 35 36 ; CHECK: # %__except 37 ; CHECK: movl %eax, %ecx 38 ; CHECK-NEXT: callq f 39