1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt %loadexampleirtransforms -passes=tut-simplifycfg -tut-simplifycfg-version=v1 < %s -S -verify-dom-info | FileCheck %s
3; RUN: opt %loadexampleirtransforms -passes=tut-simplifycfg -tut-simplifycfg-version=v2 < %s -S -verify-dom-info | FileCheck %s
4; RUN: opt %loadexampleirtransforms -passes=tut-simplifycfg -tut-simplifycfg-version=v3 < %s -S -verify-dom-info | FileCheck %s
5
6; Check that we do not crash when we remove edges multiple times in
7; the DomTreeUpdater.
8define void @test() {
9; CHECK-LABEL: @test(
10; CHECK-NEXT:  entry:
11; CHECK-NEXT:    switch i8 undef, label [[IF_THEN_EPIL:%.*]] [
12; CHECK-NEXT:    i8 32, label [[FOR_INC_EPIL:%.*]]
13; CHECK-NEXT:    i8 46, label [[FOR_INC_EPIL]]
14; CHECK-NEXT:    i8 95, label [[FOR_INC_EPIL]]
15; CHECK-NEXT:    i8 45, label [[FOR_INC_EPIL]]
16; CHECK-NEXT:    i8 126, label [[FOR_INC_EPIL]]
17; CHECK-NEXT:    ]
18; CHECK:       if.then.epil:
19; CHECK-NEXT:    unreachable
20; CHECK:       for.inc.epil:
21; CHECK-NEXT:    ret void
22;
23entry:
24  br label %for.body.epil
25
26for.body.epil:                                    ; preds = %entry
27  switch i8 undef, label %if.then.epil [
28  i8 32, label %for.inc.epil
29  i8 46, label %for.inc.epil
30  i8 95, label %for.inc.epil
31  i8 45, label %for.inc.epil
32  i8 126, label %for.inc.epil
33  ]
34
35if.then.epil:                                     ; preds = %for.body.epil
36  unreachable
37
38for.inc.epil:                                     ; preds = %for.body.epil, %for.body.epil, %for.body.epil, %for.body.epil, %for.body.epil
39  ret void
40}
41