Add test for demorgans law with constants
[oota-llvm.git] / test / Transforms / InstCombine / pow.ll
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
5 ; RUN: if as < %s | opt -instcombine | dis | grep 'call double %pow'
6 ; RUN: then exit 1
7 ; RUN: else exit 0
8 ; RUN: fi
9
10 declare double %pow(double, double)
11
12 double %test1(double %X) {
13         %Y = call double %pow(double %X, double 0.0)
14         ret double %Y    ; x^0.0 always equals 0.0
15 }
16
17 double %test2(double %X) {
18         %Y = call double %pow(double %X, double -0.0)
19         ret double %Y    ; x^-0.0 always equals 0.0
20 }
21
22 double %test3(double %X) {
23         %Y = call double %pow(double 1.0, double %X)
24         ret double %Y    ; 1.0^x always equals 1.0
25 }
26