Chris Lattner | e04d51f | 2005-03-23 23:48:56 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse | llvm-dis | not grep load |
| 2 | |
| 3 | ; This test requires the use of previous analyses to determine that |
| 4 | ; doesnotmodX does not modify X (because 'sin' doesn't). |
| 5 | |
| 6 | %X = internal global int 4 |
| 7 | |
| 8 | declare double %sin(double) |
| 9 | |
| 10 | int %test(int *%P) { |
| 11 | store int 12, int* %X |
| 12 | call double %doesnotmodX(double 1.0) |
| 13 | %V = load int* %X |
| 14 | ret int %V |
| 15 | } |
| 16 | |
| 17 | double %doesnotmodX(double %V) { |
| 18 | %V2 = call double %sin(double %V) |
| 19 | ret double %V2 |
| 20 | } |