Chris Lattner | 539c337 | 2006-02-11 09:37:07 +0000 | [diff] [blame^] | 1 | ; Testcase for calls to the standard C "pow" function |
| 2 | ; |
| 3 | ; Equivalent to: http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01786.html |
| 4 | ; RUN: llvm-as < %s | opt -simplify-libcalls -disable-output && |
| 5 | ; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call double .pow' |
Reid Spencer | 0f4a891 | 2005-04-29 05:47:05 +0000 | [diff] [blame] | 6 | |
Chris Lattner | 539c337 | 2006-02-11 09:37:07 +0000 | [diff] [blame^] | 7 | declare double %pow(double, double) |
Reid Spencer | 0f4a891 | 2005-04-29 05:47:05 +0000 | [diff] [blame] | 8 | |
Chris Lattner | 539c337 | 2006-02-11 09:37:07 +0000 | [diff] [blame^] | 9 | double %test1(double %X) { |
| 10 | %Y = call double %pow(double %X, double 0.0) |
| 11 | ret double %Y ; x^0.0 always equals 1.0 |
Reid Spencer | 0f4a891 | 2005-04-29 05:47:05 +0000 | [diff] [blame] | 12 | } |
Chris Lattner | 539c337 | 2006-02-11 09:37:07 +0000 | [diff] [blame^] | 13 | |
| 14 | double %test2(double %X) { |
| 15 | %Y = call double %pow(double %X, double -0.0) |
| 16 | ret double %Y ; x^-0.0 always equals 1.0 |
| 17 | } |
| 18 | |
| 19 | double %test3(double %X) { |
| 20 | %Y = call double %pow(double 1.0, double %X) |
| 21 | ret double %Y ; 1.0^x always equals 1.0 |
| 22 | } |
| 23 | |