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

Gabor Greif ggreif at gmail.com
Sat Jul 24 02:00:52 PDT 2010


Author: ggreif
Date: Sat Jul 24 04:00:52 2010
New Revision: 109333

URL: http://llvm.org/viewvc/llvm-project?rev=109333&view=rev
Log:
test the two/three-bit implementations in particular

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=109333&r1=109332&r2=109333&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:00:52 2010
@@ -24,7 +24,7 @@
   static char tail[22] = "s02s33s30y2y0s1x0syxS";
 	const Constant *A = ConstantArray::get (getGlobalContext(), tail, false);
   ASSERT_NE(A, (const Constant*)NULL);
-  EXPECT_EQ(21U, A->getNumOperands());
+  EXPECT_EQ(1U + 20, A->getNumOperands());
 	const Use *U = &A->getOperandUse(0);
 	const Use *Ue = &A->getOperandUse(20);
   for (; U != Ue; ++U)
@@ -33,5 +33,30 @@
   }
 }
 
+TEST(WaymarkTest, TwoBit) {
+  Use many[8212];
+	Use::initTags<2>(many, many + 8212, 0);
+  for (const Use *U = many, *Ue = many + 8212 - 1; U != Ue; ++U)
+  {
+    EXPECT_EQ(Ue + 1, Use::getImpliedUser<2>(U));
+  }
+}
+
+TEST(WaymarkTest, ThreeBit) {
+  Use many[8212];
+	Use::initTags<3>(many, many + 8212, 0);
+  for (const Use *U = many, *Ue = many + 8212 - 1; U != Ue; ++U)
+  {
+    EXPECT_EQ(Ue + 1, Use::getImpliedUser<3>(U));
+  }
+
+  std::string segment8000("32sx330312sx330232sx330212sx330132sx330112sx330032");
+  std::string segment5000("s032001s031322s031303s031230s031211s031132s031113s");
+  std::string segment3000("311y32233y32221y32203y32131y32113y32101y32023y3201");
+  std::string segment2000("3030sx3301x33000sx3232x32310sx3223x32220sx3220x321");
+  std::string segment100 ("02sx13x122sx111sx100s030s020s010s000s330s320s310s3");
+  std::string segment50  ("00y31y22y13y10y01sx31sx21sx11s02s33s30y2y0s1x0syxS");
+}
+
 }  // end anonymous namespace
 }  // end namespace llvm





More information about the llvm-branch-commits mailing list