1 ; Catchswitch is interesting because reassociate previously tried to insert
2 ; into the catchswitch block, which is impossible.
4 ; RUN: opt -reassociate -disable-output < %s
6 ; ModuleID = 'bugpoint-reduced-simplified.bc'
7 source_filename = "catchswitch.cpp"
8 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
9 target triple = "x86_64-pc-windows-msvc19.11.0"
11 define dso_local void @"?f@@YAX_N@Z"(i1 %b) local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
13 br i1 %b, label %if.then, label %if.else
15 if.then: ; preds = %entry
16 invoke void @"?g@@YAXXZ"()
17 to label %cleanup unwind label %catch.dispatch
19 if.else: ; preds = %entry
20 invoke void @"?g2@@YAXXZ"()
21 to label %cleanup unwind label %catch.dispatch
23 catch.dispatch: ; preds = %if.else, %if.then
24 %z.0 = phi i32 [ 3, %if.then ], [ 5, %if.else ]
25 %0 = catchswitch within none [label %catch] unwind to caller
27 catch: ; preds = %catch.dispatch
28 %1 = catchpad within %0 [i8* null, i32 64, i8* null]
29 %blech = sub nsw i32 5, %z.0
30 %sub = sub nsw i32 %blech, %z.0
31 call void @"?use@@YAXHH@Z"(i32 %z.0, i32 %sub) [ "funclet"(token %1) ]
34 cleanup: ; preds = %if.else, %if.then
38 declare dso_local void @"?g@@YAXXZ"() local_unnamed_addr #0
40 declare dso_local i32 @__CxxFrameHandler3(...)
42 declare dso_local void @"?g2@@YAXXZ"() local_unnamed_addr #0
44 declare dso_local void @"?use@@YAXHH@Z"(i32, i32) local_unnamed_addr #0
46 attributes #0 = { "use-soft-float"="false" }