use FileCheck for tighter checking

llvm-svn: 263679
This commit is contained in:
Sanjay Patel 2016-03-16 23:39:37 +00:00
parent 0904c69110
commit 3b32ebb97b
1 changed files with 22 additions and 4 deletions

View File

@ -1,8 +1,7 @@
; RUN: opt < %s -simplifycfg -S | \
; RUN: grep switch | count 1
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; Test that a switch going to a switch on the same value can be merged. All
; three switches in this example can be merged into one big one.
; Test that a switch going to a switch on the same value can be merged.
; All three switches in this example can be merged into one big one.
declare void @foo1()
@ -43,5 +42,24 @@ F: ; preds = %F, %T, %0, %0
D: ; preds = %F
call void @foo4( )
ret void
; CHECK-LABEL: @test1(
; CHECK-NEXT: switch i32 %V, label %infloop [
; CHECK-NEXT: i32 4, label %A
; CHECK-NEXT: i32 17, label %B
; CHECK-NEXT: i32 18, label %B
; CHECK-NEXT: i32 42, label %D
; CHECK-NEXT: ]
; CHECK: A:
; CHECK-NEXT: call void @foo1()
; CHECK-NEXT: ret void
; CHECK: B:
; CHECK-NEXT: call void @foo2()
; CHECK-NEXT: ret void
; CHECK: D:
; CHECK-NEXT: call void @foo4()
; CHECK-NEXT: ret void
; CHECK: infloop:
; CHECK-NEXT: br label %infloop
}