@@ -93,6 +93,22 @@ TEST(AsmParserTest, TypeAndConstantValueParsing) {
9393 EXPECT_TRUE (V->getType ()->isVectorTy ());
9494 ASSERT_TRUE (isa<ConstantDataVector>(V));
9595
96+ V = parseConstantValue (" <4 x i32> splat (i32 -2)" , Error, M);
97+ ASSERT_TRUE (V);
98+ EXPECT_TRUE (V->getType ()->isVectorTy ());
99+ ASSERT_TRUE (isa<ConstantDataVector>(V));
100+
101+ V = parseConstantValue (" <4 x i32> zeroinitializer" , Error, M);
102+ ASSERT_TRUE (V);
103+ EXPECT_TRUE (V->getType ()->isVectorTy ());
104+ ASSERT_TRUE (isa<Constant>(V));
105+ EXPECT_TRUE (cast<Constant>(V)->isNullValue ());
106+
107+ V = parseConstantValue (" <4 x i32> poison" , Error, M);
108+ ASSERT_TRUE (V);
109+ EXPECT_TRUE (V->getType ()->isVectorTy ());
110+ ASSERT_TRUE (isa<PoisonValue>(V));
111+
96112 V = parseConstantValue (" i32 add (i32 1, i32 2)" , Error, M);
97113 ASSERT_TRUE (V);
98114 ASSERT_TRUE (isa<ConstantInt>(V));
@@ -105,6 +121,10 @@ TEST(AsmParserTest, TypeAndConstantValueParsing) {
105121 ASSERT_TRUE (V);
106122 ASSERT_TRUE (isa<UndefValue>(V));
107123
124+ V = parseConstantValue (" ptr poison" , Error, M);
125+ ASSERT_TRUE (V);
126+ ASSERT_TRUE (isa<PoisonValue>(V));
127+
108128 EXPECT_FALSE (parseConstantValue (" duble 3.25" , Error, M));
109129 EXPECT_EQ (Error.getMessage (), " expected type" );
110130
0 commit comments