[TableGen] Fix validateOperandClass for non Phyical Reg (#118146)
[llvm-project.git] / llvm / test / Transforms / SimplifyCFG / FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase-2.ll
blob3583cd7bed9eb22525c062ddb622677c675d3de8
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
4 declare void @widget()
5 declare i16 @baz()
6 declare void @snork()
7 declare void @spam()
9 define void @zot() local_unnamed_addr align 2 personality ptr undef {
10 ; CHECK-LABEL: @zot(
11 ; CHECK-NEXT:  bb:
12 ; CHECK-NEXT:    invoke void @widget()
13 ; CHECK-NEXT:            to label [[BB14:%.*]] unwind label [[BB21:%.*]]
14 ; CHECK:       bb14:
15 ; CHECK-NEXT:    [[I0:%.*]] = invoke i16 @baz()
16 ; CHECK-NEXT:            to label [[BB15:%.*]] unwind label [[BB21]]
17 ; CHECK:       bb15:
18 ; CHECK-NEXT:    switch i16 [[I0]], label [[BB19:%.*]] [
19 ; CHECK-NEXT:      i16 42, label [[BB23:%.*]]
20 ; CHECK-NEXT:      i16 21330, label [[BB23]]
21 ; CHECK-NEXT:    ]
22 ; CHECK:       bb19:
23 ; CHECK-NEXT:    invoke void @snork()
24 ; CHECK-NEXT:            to label [[BB20:%.*]] unwind label [[BB21]]
25 ; CHECK:       bb20:
26 ; CHECK-NEXT:    unreachable
27 ; CHECK:       common.ret:
28 ; CHECK-NEXT:    ret void
29 ; CHECK:       bb21:
30 ; CHECK-NEXT:    [[I22:%.*]] = landingpad { ptr, i32 }
31 ; CHECK-NEXT:            cleanup
32 ; CHECK-NEXT:    br label [[COMMON_RET:%.*]]
33 ; CHECK:       bb23:
34 ; CHECK-NEXT:    invoke void @spam()
35 ; CHECK-NEXT:            to label [[COMMON_RET]] unwind label [[BB21]]
37 bb:
38   invoke void @widget()
39   to label %bb14 unwind label %bb21
41 bb14:                                             ; preds = %bb
42   %i0 = invoke i16 @baz()
43   to label %bb15 unwind label %bb25
45 bb15:                                             ; preds = %bb14
46   %i16 = icmp eq i16 %i0, 42
47   br i1 %i16, label %bb23, label %bb17
49 bb17:                                             ; preds = %bb15
50   %i18 = icmp eq i16 %i0, 21330
51   br i1 %i18, label %bb23, label %bb19
53 bb19:                                             ; preds = %bb17
54   invoke void @snork()
55   to label %bb20 unwind label %bb25
57 bb20:                                             ; preds = %bb19
58   unreachable
60 bb21:                                             ; preds = %bb
61   %i22 = landingpad { ptr, i32 }
62   cleanup
63   ret void
65 bb23:                                             ; preds = %bb17, %bb15
66   invoke void @spam()
67   to label %bb24 unwind label %bb25
69 bb24:                                             ; preds = %bb25, %bb23
70   ret void
72 bb25:                                             ; preds = %bb23, %bb19, %bb14
73   %i26 = landingpad { ptr, i32 }
74   cleanup
75   br label %bb24