[llvm-branch-commits] [llvm-branch] r109334 - /llvm/branches/ggreif/waymark-64/unittests/VMCore/WaymarkTest.cpp

Gabor Greif ggreif at gmail.com
Sat Jul 24 02:26:12 PDT 2010


Author: ggreif
Date: Sat Jul 24 04:26:12 2010
New Revision: 109334

URL: http://llvm.org/viewvc/llvm-project?rev=109334&view=rev
Log:
comparing segment8000 successfully

Modified:
    llvm/branches/ggreif/waymark-64/unittests/VMCore/WaymarkTest.cpp

Modified: llvm/branches/ggreif/waymark-64/unittests/VMCore/WaymarkTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/waymark-64/unittests/VMCore/WaymarkTest.cpp?rev=109334&r1=109333&r2=109334&view=diff
==============================================================================
--- llvm/branches/ggreif/waymark-64/unittests/VMCore/WaymarkTest.cpp (original)
+++ llvm/branches/ggreif/waymark-64/unittests/VMCore/WaymarkTest.cpp Sat Jul 24 04:26:12 2010
@@ -34,7 +34,8 @@
 }
 
 TEST(WaymarkTest, TwoBit) {
-  Use many[8212];
+  Use* many = new Use[8212];
+  ASSERT_TRUE(many);
 	Use::initTags<2>(many, many + 8212, 0);
   for (const Use *U = many, *Ue = many + 8212 - 1; U != Ue; ++U)
   {
@@ -42,8 +43,15 @@
   }
 }
 
+char m3(const Use& U)
+{
+  static char ms[9] = "0123sxyS";
+  return ms[U.Prev.getInt()];
+}
+
 TEST(WaymarkTest, ThreeBit) {
-  Use many[8212];
+  Use* many = new Use[8212];
+  ASSERT_TRUE(many);
 	Use::initTags<3>(many, many + 8212, 0);
   for (const Use *U = many, *Ue = many + 8212 - 1; U != Ue; ++U)
   {
@@ -56,6 +64,11 @@
   std::string segment2000("3030sx3301x33000sx3232x32310sx3223x32220sx3220x321");
   std::string segment100 ("02sx13x122sx111sx100s030s020s010s000s330s320s310s3");
   std::string segment50  ("00y31y22y13y10y01sx31sx21sx11s02s33s30y2y0s1x0syxS");
+
+	std::string result(50, ' ');
+	std::transform(many + 8212 - 8000, many + 8212 - 7950, result.begin(), m3);
+  EXPECT_EQ('2', result[49]);
+  EXPECT_EQ(segment8000, result);
 }
 
 }  // end anonymous namespace





More information about the llvm-branch-commits mailing list