[MIParser] Set RegClassOrRegBank during instruction parsing
[llvm-complete.git] / test / Transforms / SimplifyCFG / merge-cleanuppads.ll
blob23bbbca72346e42d7492e9a413a4dac4be1db543
1 ; RUN: opt -S -simplifycfg < %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-msvc18.0.0"
5 ; Function Attrs: uwtable
6 define void @test1() #0 personality i32 (...)* @__CxxFrameHandler3 {
7 entry:
8   invoke void @may_throw(i32 3)
9           to label %invoke.cont unwind label %ehcleanup
11 invoke.cont:                                      ; preds = %entry
12   tail call void @may_throw(i32 2) #2
13   tail call void @may_throw(i32 1) #2
14   ret void
16 ehcleanup:                                        ; preds = %entry
17   %cp = cleanuppad within none []
18   tail call void @may_throw(i32 2) #2 [ "funclet"(token %cp) ]
19   cleanupret from %cp unwind label %ehcleanup2
21 ehcleanup2:
22   %cp2 = cleanuppad within none []
23   tail call void @may_throw(i32 1) #2 [ "funclet"(token %cp2) ]
24   cleanupret from %cp2 unwind to caller
27 ; CHECK-LABEL: define void @test1(
28 ; CHECK: %[[cp:.*]] = cleanuppad within none []
29 ; CHECK: tail call void @may_throw(i32 2) #2 [ "funclet"(token %[[cp]]) ]
30 ; CHECK: tail call void @may_throw(i32 1) #2 [ "funclet"(token %[[cp]]) ]
31 ; CHECK: cleanupret from %[[cp]] unwind to caller
33 declare void @may_throw(i32) #1
35 declare i32 @__CxxFrameHandler3(...)
37 attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
38 attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
39 attributes #2 = { nounwind }