[llvm] r263679 - use FileCheck for tighter checking
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 16 16:39:37 PDT 2016
Author: spatel
Date: Wed Mar 16 18:39:37 2016
New Revision: 263679
URL: http://llvm.org/viewvc/llvm-project?rev=263679&view=rev
Log:
use FileCheck for tighter checking
Modified:
llvm/trunk/test/Transforms/SimplifyCFG/switch_switch_fold.ll
Modified: llvm/trunk/test/Transforms/SimplifyCFG/switch_switch_fold.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/switch_switch_fold.ll?rev=263679&r1=263678&r2=263679&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyCFG/switch_switch_fold.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyCFG/switch_switch_fold.ll Wed Mar 16 18:39:37 2016
@@ -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
}
More information about the llvm-commits
mailing list