[coco] Support copy over ElemID (#786)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 25 Jul 2018 01:48:02 +0000 (10:48 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 25 Jul 2018 01:48:02 +0000 (10:48 +0900)
This commit supports copy over ElemID values.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/coco/core/include/coco/IR/ElemID.h
contrib/coco/core/src/IR/ElemID.test.cpp

index 6cacef8..115bfa3 100644 (file)
@@ -24,7 +24,7 @@ public:
   uint32_t value(void) const { return _value; }
 
 private:
-  uint32_t const _value;
+  uint32_t _value;
 };
 
 } // namespace coco
index 545846e..f1d51ae 100644 (file)
@@ -11,6 +11,16 @@ TEST(IR_ELEM_ID, constructor)
   ASSERT_EQ(id.value(), 128);
 }
 
+TEST(IR_ELEM_ID, copy)
+{
+  coco::ElemID src{16};
+  coco::ElemID dst{32};
+
+  dst = src;
+
+  ASSERT_EQ(dst.value(), 16);
+}
+
 TEST(IR_ELEM_ID, std_vector_compatible)
 {
   // ElemID SHOULD be compatible with standard container (including std::vector)