blob: 09e7024474876f5e6fd557275e4f44b0e9a5987b [file] [log] [blame]
Chris Lattner25743e92003-03-05 20:35:24 +00001; Test merging of blocks with phi nodes.
2;
Misha Brukmanedf4bab2003-09-16 15:29:54 +00003; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep 'N:'
Chris Lattner25743e92003-03-05 20:35:24 +00004;
5
6int %test(bool %a) {
7Q:
8 br bool %a, label %N, label %M
9N:
10 br label %M
11M:
12 ; It's ok to merge N and M because the incoming values for W are the
13 ; same for both cases...
14 %W = phi int [2, %N], [2, %Q]
15 %R = add int %W, 1
16 ret int %R
17}
18