Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame^] | 1 | ; 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 | |
| 9 | int %test1(bool %C) { |
| 10 | %P = select bool %C, int* %X, int* %Y |
| 11 | %V = load int* %P |
| 12 | ret int %V |
| 13 | } |
| 14 | |
| 15 | |
| 16 | int %test2(bool %C) { |
| 17 | br bool %C, label %T, label %Cont |
| 18 | T: |
| 19 | br label %Cont |
| 20 | Cont: |
| 21 | %P = phi int* [%X, %0], [%Y, %T] |
| 22 | %V = load int* %P |
| 23 | ret int %V |
| 24 | } |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |