brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · f1ecd66 Raw
57 lines · plain
1; Check that verification doesn't fail when reducing a function with2; unreachable blocks.3;4; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=unreachable-basic-blocks --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t5; RUN: FileCheck -check-prefix=UNREACHABLE %s < %t6 7; 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 %t8; RUN: FileCheck -check-prefix=REACHABLE %s < %t9 10; CHECK-INTERESTINGNESS: test011; CHECK-INTERESTINGNESS: test112 13; UNREACHABLE: define void @test0() {14; UNREACHABLE-NEXT: entry:15; UNREACHABLE-NEXT:   br label %exit16 17; UNREACHABLE-NOT: unreachable18; UNREACHABLE: exit:19; UNREACHABLE-NEXT: ret void20 21 22; basic-blocks cannot deal with unreachable blocks, leave it behind23; REACHABLE: define void @test0() {24; REACHABLE: entry:25; REACHABLE: unreachable:26; REACHABLE: exit:27 28define void @test0() {29entry:30  br label %exit31 32unreachable:                                        ; No predecessors!33  br label %exit34 35exit:36  ret void37}38 39; UNREACHABLE: define void @test1() {40; UNREACHABLE-NEXT: entry:41; UNREACHABLE-NEXT:   br label %exit42 43; REACHABLE: define void @test1() {44; REACHABLE: entry:45; REACHABLE: unreachable:46; REACHABLE: exit:47define void @test1() {48entry:49  br label %exit50 51unreachable:52  br label %unreachable53 54exit:55  ret void56}57