blob: 2389c0a8bcafdfc67cda7839e3d630a3d8618ca9 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Test that PHI nodes and select instructions do not necessarily make stuff
2; non-constant.
3
4; RUN: llvm-upgrade < %s | llvm-as | 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