2009-12-22 06:04:26 +00:00
|
|
|
; Test CFG simplify removal of branch instructions.
|
2002-05-06 02:37:38 +00:00
|
|
|
;
|
2009-12-22 06:04:26 +00:00
|
|
|
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
2002-05-06 02:37:38 +00:00
|
|
|
|
2008-03-18 03:45:45 +00:00
|
|
|
define void @test1() {
|
2010-12-13 05:10:30 +00:00
|
|
|
br label %1
|
2008-03-18 03:45:45 +00:00
|
|
|
ret void
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @test1(
|
2009-12-22 06:04:26 +00:00
|
|
|
; CHECK-NEXT: ret void
|
2002-05-06 02:37:38 +00:00
|
|
|
}
|
|
|
|
|
2008-03-18 03:45:45 +00:00
|
|
|
define void @test2() {
|
|
|
|
ret void
|
|
|
|
ret void
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @test2(
|
2009-12-22 06:04:26 +00:00
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
; CHECK-NEXT: }
|
2002-05-06 02:37:38 +00:00
|
|
|
}
|
|
|
|
|
2008-03-18 03:45:45 +00:00
|
|
|
define void @test3(i1 %T) {
|
2010-12-13 05:10:30 +00:00
|
|
|
br i1 %T, label %1, label %1
|
2008-03-18 03:45:45 +00:00
|
|
|
ret void
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @test3(
|
2009-12-22 06:04:26 +00:00
|
|
|
; CHECK-NEXT: ret void
|
2002-05-06 02:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-22 06:07:30 +00:00
|
|
|
; PR5795
|
|
|
|
define void @test5(i32 %A) {
|
|
|
|
switch i32 %A, label %return [
|
2010-12-13 05:10:30 +00:00
|
|
|
i32 2, label %1
|
|
|
|
i32 10, label %2
|
2009-12-22 06:07:30 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
ret void
|
|
|
|
|
|
|
|
ret void
|
|
|
|
|
|
|
|
return: ; preds = %entry
|
|
|
|
ret void
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @test5(
|
2009-12-22 06:07:30 +00:00
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
}
|