llvm-6502/test/Transforms/SimplifyCFG/basictest.ll
Chris Lattner c232a2e559 make these tests a bit less fragile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121682 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 05:10:30 +00:00

54 lines
859 B
LLVM

; Test CFG simplify removal of branch instructions.
;
; RUN: opt < %s -simplifycfg -S | FileCheck %s
define void @test1() {
br label %1
ret void
; CHECK: @test1
; CHECK-NEXT: ret void
}
define void @test2() {
ret void
ret void
; CHECK: @test2
; CHECK-NEXT: ret void
; CHECK-NEXT: }
}
define void @test3(i1 %T) {
br i1 %T, label %1, label %1
ret void
; CHECK: @test3
; CHECK-NEXT: ret void
}
define void @test4() {
br label %return
return:
ret void
; CHECK: @test4
; CHECK-NEXT: ret void
}
@test4g = global i8* blockaddress(@test4, %return)
; PR5795
define void @test5(i32 %A) {
switch i32 %A, label %return [
i32 2, label %1
i32 10, label %2
]
ret void
ret void
return: ; preds = %entry
ret void
; CHECK: @test5
; CHECK-NEXT: ret void
}