@@ -93,6 +93,22 @@ TEST(AsmParserTest, TypeAndConstantValueParsing) {
93
93
EXPECT_TRUE (V->getType ()->isVectorTy ());
94
94
ASSERT_TRUE (isa<ConstantDataVector>(V));
95
95
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
+
96
112
V = parseConstantValue (" i32 add (i32 1, i32 2)" , Error, M);
97
113
ASSERT_TRUE (V);
98
114
ASSERT_TRUE (isa<ConstantInt>(V));
@@ -105,6 +121,10 @@ TEST(AsmParserTest, TypeAndConstantValueParsing) {
105
121
ASSERT_TRUE (V);
106
122
ASSERT_TRUE (isa<UndefValue>(V));
107
123
124
+ V = parseConstantValue (" ptr poison" , Error, M);
125
+ ASSERT_TRUE (V);
126
+ ASSERT_TRUE (isa<PoisonValue>(V));
127
+
108
128
EXPECT_FALSE (parseConstantValue (" duble 3.25" , Error, M));
109
129
EXPECT_EQ (Error.getMessage (), " expected type" );
110
130
0 commit comments