blob: b96a4a6bb12a9d63ca6b631af1b778b68d2d042c [file] [log] [blame]
Chris Lattner05ed0392003-08-17 19:37:57 +00001; This test checks to make sure that 'br X, Dest, Dest' is folded into
2; 'br Dest'. This can only happen after the 'Z' block is eliminated. This is
3; due to the fact that the SimplifyCFG function does not use
4; the ConstantFoldTerminator function.
5
Misha Brukmanedf4bab2003-09-16 15:29:54 +00006; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep 'br bool %c2'
Chris Lattner05ed0392003-08-17 19:37:57 +00007
8declare void %noop()
9
10int %test(bool %c1, bool %c2) {
11 call void %noop()
12 br bool %c1, label %A, label %Y
13A:
14 call void %noop()
15 br bool %c2, label %Z, label %X ; Can be converted to unconditional br
16Z:
17 br label %X
18X:
19 call void %noop()
20 ret int 0
21Y:
22 call void %noop()
23 br label %X
24}