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

Chris Lattner lattner at cs.uiuc.edu
Wed Dec 10 13:23:06 PST 2003


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

lists1.cpp updated: 1.2 -> 1.3

---
Log message:

Fix a bug in the benchmark.  Apparently these things haven't been tested with the default input sizes


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

Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp
diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.2 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.3
--- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.2	Mon Oct  6 20:03:17 2003
+++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp	Wed Dec 10 13:22:22 2003
@@ -1,5 +1,5 @@
 // -*- mode: c++ -*-
-// $Id: lists1.cpp,v 1.2 2003/10/07 01:03:17 lattner Exp $
+// $Id: lists1.cpp,v 1.3 2003/12/10 19:22:22 lattner Exp $
 // http://www.bagley.org/~doug/shootout/
 
 #include <iostream>
@@ -19,7 +19,7 @@
 void list_print_n (list<int> L, int n) {
     int c, lastc = n - 1;
     list<int>::iterator i;
-    for (c = 0, i = L.begin(); i != L.end(), c < n; ++i, ++c) {
+    for (c = 0, i = L.begin(); i != L.end() && c < n; ++i, ++c) {
 	cout << (*i);
 	if (c < lastc) cout << " ";
     }





More information about the llvm-commits mailing list