; Testcase for calls to the standard C "pow" function
; RUN: if as < %s | opt -instcombine | dis | grep 'call double %pow'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi

declare double %pow(double, double)

double %test1(double %X) {
	%Y = call double %pow(double %X, double 0.0)
	ret double %Y    ; x^0.0 always equals 0.0
}

double %test2(double %X) {
	%Y = call double %pow(double %X, double -0.0)
	ret double %Y    ; x^-0.0 always equals 0.0
}

double %test3(double %X) {
	%Y = call double %pow(double 1.0, double %X)
	ret double %Y    ; 1.0^x always equals 1.0
}


; Testcase for calls to the standard C "pow" function
;
; Equivalent to: http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01786.html

; RUN: if as < %s | opt -instcombine | dis | grep 'call double %pow'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi

declare double %pow(double, double)

double %test1(double %X) {
	%Y = call double %pow(double %X, double 0.0)
	ret double %Y    ; x^0.0 always equals 0.0
}

double %test2(double %X) {
	%Y = call double %pow(double %X, double -0.0)
	ret double %Y    ; x^-0.0 always equals 0.0
}

double %test3(double %X) {
	%Y = call double %pow(double 1.0, double %X)
	ret double %Y    ; 1.0^x always equals 1.0
}


Add a link to source of inspiration
Add a link to source of inspiration


git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@5707 91177308-0d34-0410-b5e6-96231b3b80d8
