1 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=basic-blocks --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
2 ; RUN: FileCheck %s < %t
4 ; Make sure an invalid reduction isn't produced due to leaving behind
5 ; invalid code in %bb8 after it becomes unreachable.
7 ; CHECK-INTERESTINGNESS: store i32 0,
8 ; CHECK-INTERESTINGNESS: store i32 1,
9 ; CHECK-INTERESTINGNESS: store i32 2,
13 ; CHECK-NEXT: store i32 0, ptr addrspace(3) null, align 4
15 ; CHECK: bb6: ; preds = %bb8, %bb
16 ; CHECK-NEXT: store i32 1, ptr addrspace(3) null, align 4
18 ; CHECK: bb8: ; preds = %bb6
19 ; CHECK-NEXT: %tmp = phi ptr addrspace(5) [ null, %bb6 ]
20 define amdgpu_kernel void @foo(i32 %arg) {
22 store i32 0, ptr addrspace(3) null
25 bb6: ; preds = %bb10, %bb9, %bb8, %bb
26 store i32 1, ptr addrspace(3) null
27 switch i32 0, label %bb7 [
35 %tmp = phi ptr addrspace(5) [ null, %bb6 ]
36 store i32 2, ptr addrspace(5) %tmp
37 switch i32 %arg, label %bb6 [