Chris Lattner | 607411b | 2003-06-28 21:56:22 +0000 | [diff] [blame] | 1 | ; This tests to make sure that G ends up in the globals graph of the BU pass. |
| 2 | ; If it is not, then %G will get converted to a 'constant' from a 'global' |
| 3 | ; |
Misha Brukman | 14285c8 | 2003-09-15 20:02:53 +0000 | [diff] [blame^] | 4 | ; RUN: llvm-as < %s | opt -ds-opt -globaldce | llvm-dis | grep %G |
Chris Lattner | 607411b | 2003-06-28 21:56:22 +0000 | [diff] [blame] | 5 | |
| 6 | |
| 7 | %G = internal global int 0 ; <int*> [#uses=2] |
| 8 | |
| 9 | implementation ; Functions: |
| 10 | |
| 11 | internal void %foo() { |
| 12 | %tmp.0 = load int* %G ; <int> [#uses=1] |
| 13 | %tmp.1 = add int %tmp.0, 1 ; <int> [#uses=1] |
| 14 | store int %tmp.1, int* %G |
| 15 | ret void |
| 16 | } |
| 17 | |
| 18 | int %main() { |
| 19 | call void %foo( ) |
| 20 | ret int 0 |
| 21 | } |