blob: 29890600def61b8e6bbb1c1d890bfb659d06d56b [file] [log] [blame]
Chris Lattner904697e2004-10-07 19:16:26 +00001; Test that PHI nodes and select instructions do not necessarily make stuff
2; non-constant.
3
4; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global
5
6%X = internal global int 4
7%Y = internal global int 5
8
9int %test1(bool %C) {
10 %P = select bool %C, int* %X, int* %Y
11 %V = load int* %P
12 ret int %V
13}
14
15
16int %test2(bool %C) {
17 br bool %C, label %T, label %Cont
18T:
19 br label %Cont
20Cont:
21 %P = phi int* [%X, %0], [%Y, %T]
22 %V = load int* %P
23 ret int %V
24}
25
26
27
28
29