2006-12-04 00:17:19 +08:00
|
|
|
; RUN: llvm-upgrade %s | llvm-as -f -o %t.bc
|
2004-11-07 07:32:43 +08:00
|
|
|
; RUN: lli %t.bc > /dev/null
|
|
|
|
|
2002-12-25 13:14:29 +08:00
|
|
|
|
2002-12-29 04:00:47 +08:00
|
|
|
double %test(double* %DP, double %Arg) {
|
2002-12-25 13:14:29 +08: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 22:45:37 +08:00
|
|
|
%Z1 = div double %Z, %W
|
2002-12-29 04:00:47 +08:00
|
|
|
%Q = add double %Z, %Arg
|
2003-01-13 08:56:54 +08:00
|
|
|
%R = cast double %Q to double
|
|
|
|
store double %R, double* %DP
|
2002-12-25 13:14:29 +08:00
|
|
|
ret double %Z
|
|
|
|
}
|
|
|
|
|
|
|
|
int %main() {
|
|
|
|
%X = alloca double
|
2007-02-02 05:58:46 +08:00
|
|
|
store double 0.0, double* %X
|
2003-01-13 08:56:54 +08:00
|
|
|
call double %test(double* %X, double 2.0)
|
2002-12-25 13:14:29 +08:00
|
|
|
ret int 0
|
|
|
|
}
|