• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -sink -S < %s | FileCheck %s
2
3target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
4target triple = "i686-pc-windows-msvc"
5
6define void @h() personality i32 (...)* @__CxxFrameHandler3 {
7entry:
8  %call = call i32 @g(i32 1) readnone
9  invoke void @_CxxThrowException(i8* null, i8* null) noreturn
10          to label %unreachable unwind label %catch.dispatch
11
12catch.dispatch:                                   ; preds = %entry
13  %cs = catchswitch within none [label %catch] unwind to caller
14
15catch:                                            ; preds = %catch.dispatch
16  %cp = catchpad within %cs [i8* null, i32 64, i8* null]
17  catchret from %cp to label %try.cont
18
19try.cont:                                         ; preds = %catch
20  call void @k(i32 %call)
21  ret void
22
23unreachable:                                      ; preds = %entry
24  unreachable
25}
26
27declare x86_stdcallcc void @_CxxThrowException(i8*, i8*)
28
29declare i32 @__CxxFrameHandler3(...)
30
31declare i32 @g(i32) readnone
32
33declare void @k(i32)
34
35; CHECK-LABEL: define void @h(
36; CHECK: call i32 @g(i32 1)
37; CHECK-NEXT: invoke void @_CxxThrowException(
38