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

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


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

ary.cpp added (r1.1)

---
Log message:

Initial checkin of ary test


---
Diffs of the changes:  (+0 -0)

Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary.cpp
diff -c /dev/null llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary.cpp:1.1
*** /dev/null	Mon Oct  6 19:51:10 2003
--- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary.cpp	Mon Oct  6 19:51:00 2003
***************
*** 0 ****
--- 1,23 ----
+ // -*- mode: c++ -*-
+ // $Id: ary.cpp,v 1.1 2003/10/07 00:51:00 lattner Exp $
+ // http://www.bagley.org/~doug/shootout/
+ 
+ #include <iostream.h>
+ #include <vector>
+ 
+ int
+ main(int argc, char *argv[]) {
+     int i, n = ((argc == 2) ? atoi(argv[1]) : 1);
+     typedef vector<int> ARY;
+     ARY x(n);
+     ARY y(n);
+ 
+     for (i=0; i<n; i++) {
+ 	x[i] = i;
+     }
+     for (int i = n - 1; i >= 0; --i) {
+         y[i] = x[i];
+     }
+ 
+     cout << y.back() << endl;
+ }





More information about the llvm-commits mailing list