2009-09-11 18:01:28 +00:00
|
|
|
; RUN: opt < %s -simplifycfg -S | not grep unreachable
|
2004-10-18 04:06:41 +00:00
|
|
|
|
2008-03-18 03:45:45 +00:00
|
|
|
define void @test1(i1 %C, i1* %BP) {
|
|
|
|
br i1 %C, label %T, label %F
|
|
|
|
T: ; preds = %0
|
|
|
|
store i1 %C, i1* %BP
|
|
|
|
unreachable
|
|
|
|
F: ; preds = %0
|
|
|
|
ret void
|
2004-10-18 04:06:41 +00:00
|
|
|
}
|
|
|
|
|
2008-03-18 03:45:45 +00:00
|
|
|
define void @test2() {
|
|
|
|
invoke void @test2( )
|
|
|
|
to label %N unwind label %U
|
|
|
|
U: ; preds = %0
|
|
|
|
unreachable
|
|
|
|
N: ; preds = %0
|
|
|
|
ret void
|
2004-10-18 04:06:41 +00:00
|
|
|
}
|
|
|
|
|
2008-03-18 03:45:45 +00:00
|
|
|
define i32 @test3(i32 %v) {
|
|
|
|
switch i32 %v, label %default [
|
|
|
|
i32 1, label %U
|
|
|
|
i32 2, label %T
|
|
|
|
]
|
|
|
|
default: ; preds = %0
|
|
|
|
ret i32 1
|
|
|
|
U: ; preds = %0
|
|
|
|
unreachable
|
|
|
|
T: ; preds = %0
|
|
|
|
ret i32 2
|
2004-10-18 04:06:41 +00:00
|
|
|
}
|
2008-03-18 03:45:45 +00:00
|
|
|
|