1 ; RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=basic-blocks --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS0 --test-arg %s --test-arg --input-file %s -o %t.0
2 ; RUN: FileCheck -check-prefix=RESULT0 %s < %t.0
4 ; RUN: llvm-reduce -abort-on-invalid-reduction --delta-passes=basic-blocks --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS1 --test-arg %s --test-arg --input-file %s -o %t.1
5 ; RUN: FileCheck -check-prefix=RESULT1 %s < %t.1
7 ; CHECK-INTERESTINGNESS0: store i32 1,
8 ; CHECK-INTERESTINGNESS0: store i32 2,
10 ; CHECK-INTERESTINGNESS1: store i32 2,
14 ; RESULT0-NEXT: %bb.load = load i32, ptr null, align 4
15 ; RESULT0-NEXT: store i32 0, ptr null, align 4
16 ; RESULT0-NEXT: br i1 %arg0, label %bb1, label %bb2
19 ; RESULT0-NEXT: store i32 1, ptr null, align 4
20 ; RESULT0-NEXT: ret void
22 ; RESULT0: bb2: ; preds = %bb
23 ; RESULT0-NEXT: store i32 2, ptr null, align 4
24 ; RESULT0-NEXT: switch i32 %bb.load, label %bb1 [
25 ; RESULT0-NEXT: i32 0, label %bb1
30 ; RESULT1-NEXT: %bb.load = load i32, ptr null, align 4
31 ; RESULT1-NEXT: store i32 0, ptr null, align 4
32 ; RESULT1-NEXT: br label %bb2
35 ; RESULT1-NEXT: store i32 2, ptr null, align 4
36 ; RESULT1-NEXT: ret void
37 define void @main(i1 %arg0) {
39 %bb.load = load i32, ptr null
41 br i1 %arg0, label %bb1, label %bb2
44 %bb1.phi = phi i32 [%bb.load, %bb], [9, %bb3], [%bb2.phi, %bb2]
49 %bb2.phi = phi i32 [%bb.load, %bb], [%bb3.load, %bb3]
51 switch i32 %bb2.phi, label %bb3 [
57 %bb3.load = load i32, ptr null
59 br i1 true, label %bb2, label %bb1