1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
9 define void @zot() local_unnamed_addr align 2 personality ptr undef {
12 ; CHECK-NEXT: invoke void @widget()
13 ; CHECK-NEXT: to label [[BB14:%.*]] unwind label [[BB21:%.*]]
15 ; CHECK-NEXT: [[I0:%.*]] = invoke i16 @baz()
16 ; CHECK-NEXT: to label [[BB15:%.*]] unwind label [[BB21]]
18 ; CHECK-NEXT: switch i16 [[I0]], label [[BB19:%.*]] [
19 ; CHECK-NEXT: i16 42, label [[BB23:%.*]]
20 ; CHECK-NEXT: i16 21330, label [[BB23]]
23 ; CHECK-NEXT: invoke void @snork()
24 ; CHECK-NEXT: to label [[BB20:%.*]] unwind label [[BB21]]
26 ; CHECK-NEXT: unreachable
28 ; CHECK-NEXT: ret void
30 ; CHECK-NEXT: [[I22:%.*]] = landingpad { ptr, i32 }
32 ; CHECK-NEXT: br label [[COMMON_RET:%.*]]
34 ; CHECK-NEXT: invoke void @spam()
35 ; CHECK-NEXT: to label [[COMMON_RET]] unwind label [[BB21]]
39 to label %bb14 unwind label %bb21
42 %i0 = invoke i16 @baz()
43 to label %bb15 unwind label %bb25
46 %i16 = icmp eq i16 %i0, 42
47 br i1 %i16, label %bb23, label %bb17
50 %i18 = icmp eq i16 %i0, 21330
51 br i1 %i18, label %bb23, label %bb19
55 to label %bb20 unwind label %bb25
61 %i22 = landingpad { ptr, i32 }
65 bb23: ; preds = %bb17, %bb15
67 to label %bb24 unwind label %bb25
69 bb24: ; preds = %bb25, %bb23
72 bb25: ; preds = %bb23, %bb19, %bb14
73 %i26 = landingpad { ptr, i32 }