2004-11-07 00:32:43 +01:00
|
|
|
; RUN: llvm-as -f %s -o %t.bc
|
|
|
|
; RUN: lli %t.bc > /dev/null
|
|
|
|
|
2002-12-25 06:14:29 +01:00
|
|
|
|
2002-12-28 21:00:47 +01:00
|
|
|
double %test(double* %DP, double %Arg) {
|
2002-12-25 06:14:29 +01:00
|
|
|
%D = load double* %DP
|
|
|
|
%V = add double %D, 1.0
|
|
|
|
%W = sub double %V, %V
|
|
|
|
%X = mul double %W, %W
|
|
|
|
%Y = div double %X, %X
|
|
|
|
%Z = rem double %Y, %Y
|
2003-11-26 15:45:37 +01:00
|
|
|
%Z1 = div double %Z, %W
|
2002-12-28 21:00:47 +01:00
|
|
|
%Q = add double %Z, %Arg
|
2003-01-13 01:56:54 +01:00
|
|
|
%R = cast double %Q to double
|
|
|
|
store double %R, double* %DP
|
2002-12-25 06:14:29 +01:00
|
|
|
ret double %Z
|
|
|
|
}
|
|
|
|
|
|
|
|
int %main() {
|
|
|
|
%X = alloca double
|
2003-01-13 01:56:54 +01:00
|
|
|
call double %test(double* %X, double 2.0)
|
2002-12-25 06:14:29 +01:00
|
|
|
ret int 0
|
|
|
|
}
|