[llvm-commits] CVS: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Oct 6 19:58:00 PDT 2003


Changes in directory llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++:

ackermann.cpp added (r1.1)

---
Log message:

new testcase


---
Diffs of the changes:  (+17 -2)

Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp
diff -c /dev/null llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp:1.1
*** /dev/null	Mon Oct  6 19:57:18 2003
--- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp	Mon Oct  6 19:57:08 2003
***************
*** 0 ****
--- 1,17 ----
+ // -*- mode: c++ -*-
+ // $Id: ackermann.cpp,v 1.1 2003/10/07 00:57:08 lattner Exp $
+ // http://www.bagley.org/~doug/shootout/
+ 
+ #include <iostream>
+ #include <stdlib.h>
+ 
+ using namespace std;
+ 
+ int Ack(int M, int N) { return(M ? (Ack(M-1,N ? Ack(M,(N-1)) : 1)) : N+1); }
+ 
+ int main(int argc, char *argv[]) {
+     int n = ((argc == 2) ? atoi(argv[1]) : 1);
+ 
+     cout << "Ack(3," << n << "): " << Ack(3, n) << endl;
+     return(0);
+ }





More information about the llvm-commits mailing list