1 ; RUN: opt -S -codegenprepare < %s | FileCheck %s
2 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-pc-windows-msvc"
5 @rtti = external global i8
7 define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
10 %tmpcast = bitcast i8* %e to i16*
11 invoke void @_CxxThrowException(i8* null, i8* null)
12 to label %catchret.dest unwind label %catch.dispatch
14 catch.dispatch: ; preds = %entry
15 %0 = catchswitch within none [label %catch] unwind to caller
17 catch: ; preds = %catch.dispatch
18 %1 = catchpad within %0 [i8* @rtti, i32 0, i16* %tmpcast]
19 catchret from %1 to label %catchret.dest
21 catchret.dest: ; preds = %catch
24 ; CHECK-LABEL: define void @test1(
25 ; CHECK: %[[alloca:.*]] = alloca i8
26 ; CHECK-NEXT: %[[bc:.*]] = bitcast i8* %[[alloca]] to i16*
28 ; CHECK: catchpad within {{.*}} [i8* @rtti, i32 0, i16* %[[bc]]]
30 declare void @_CxxThrowException(i8*, i8*)
32 declare i32 @__CxxFrameHandler3(...)