projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add support for zero initialized unions, patch by Tim Northover!
[oota-llvm.git]
/
test
/
Transforms
/
SimplifyCFG
/
basictest.ll
diff --git
a/test/Transforms/SimplifyCFG/basictest.ll
b/test/Transforms/SimplifyCFG/basictest.ll
index 9dac7c05ab61ce65e536917c2395c69ddbd5e9e3..83a9fa7ad1b8da349ba0e1bf8c576c2177efac7e 100644
(file)
--- a/
test/Transforms/SimplifyCFG/basictest.ll
+++ b/
test/Transforms/SimplifyCFG/basictest.ll
@@
-1,24
+1,59
@@
-; Test CFG simplify removal of branch instructions.
..
+; Test CFG simplify removal of branch instructions.
;
;
-; RUN:
llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
+; RUN:
opt < %s -simplifycfg -S | FileCheck %s
+define void @test1() {
+ br label %BB1
+BB1: ; preds = %0
+ ret void
+; CHECK: @test1
+; CHECK-NEXT: ret void
+}
-void "test1"() {
- br label %BB1
-BB1:
- ret void
+define void @test2() {
+ ret void
+BB1: ; No predecessors!
+ ret void
+; CHECK: @test2
+; CHECK-NEXT: ret void
+; CHECK-NEXT: }
}
}
-void "test2"() {
- ret void
-BB1:
- ret void
+define void @test3(i1 %T) {
+ br i1 %T, label %BB1, label %BB1
+BB1: ; preds = %0, %0
+ ret void
+; CHECK: @test3
+; CHECK-NEXT: ret void
}
}
-void "test3"(bool %T) {
- br bool %T, label %BB1, label %BB1
-BB1:
- 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 %bb
+ i32 10, label %bb1
+ ]
+bb: ; preds = %entry
+ ret void
+
+bb1: ; preds = %entry
+ ret void
+
+return: ; preds = %entry
+ ret void
+; CHECK: @test5
+; CHECK-NEXT: bb:
+; CHECK-NEXT: ret void
+}