Reid Spencer | 0f4a891 | 2005-04-29 05:47:05 +0000 | [diff] [blame^] | 1 | ; Test that the StrCatOptimizer works correctly |
| 2 | ; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'pow' |
| 3 | |
| 4 | declare double %pow(double,double) |
| 5 | %fpstorage = global double 5.0 |
| 6 | |
| 7 | implementation ; Functions: |
| 8 | |
| 9 | int %main () { |
| 10 | %fpnum = load double* %fpstorage; |
| 11 | %one = call double %pow(double 1.0, double %fpnum) |
| 12 | %two = call double %pow(double %one, double 0.5) |
| 13 | %three = call double %pow(double %two, double 1.0) |
| 14 | %four = call double %pow(double %three, double -1.0) |
| 15 | %five = call double %pow(double %four, double 0.0) |
| 16 | %result = cast double %five to int |
| 17 | ret int %result |
| 18 | } |