--- /dev/null
+#ifndef __COCO_IR_BAG_H__
+#define __COCO_IR_BAG_H__
+
+#include <cstdint>
+
+namespace coco
+{
+
+/***
+ * @brief A collection of (abstracted) elements of the same type
+ *
+ * When there are N elements in a bag, we refer to N as the size of this bag, and every
+ * element in a bag has a unique numeric ID whose range is [0, N).
+ *
+ * NOTE 'Bag' is not a container (such as std::vector). 'Bag' just assures that there are
+ * N elements. It does not state about its value.
+ *
+ * NOTE coco IR treats Bag as virtual memory allocation
+ */
+class Bag
+{
+public:
+ Bag(uint32_t size) : _size{size}
+ {
+ // DO NOTHING
+ }
+
+public:
+ uint32_t size(void) const { return _size; }
+
+private:
+ uint32_t const _size;
+};
+
+} // namespace coco
+
+#endif // __COCO_IR_BAG_H__
--- /dev/null
+#include "coco/IR/Bag.h"
+
+#include <gtest/gtest.h>
+
+TEST(IR_BAG, ctor_should_set_size)
+{
+ coco::Bag b{3};
+
+ ASSERT_EQ(b.size(), 3);
+}