Skip to content

Commit d818fd5

Browse files
author
Aidan
committed
added some expect_false tests for mask capture and matching
1 parent c77ac06 commit d818fd5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ TEST_F(SelectionDAGPatternMatchTest, matchVecShuffle) {
124124
auto Int32VT = EVT::getIntegerVT(Context, 32);
125125
auto VInt32VT = EVT::getVectorVT(Context, Int32VT, 4);
126126
SmallVector<int, 4> MaskData = {2, 0, 3, 1};
127+
SmallVector<int, 4> otherMaskData = {1, 2, 3, 4};
127128
ArrayRef<int> CapturedMask;
128129

129130
SDValue V0 = DAG->getCopyFromReg(DAG->getEntryNode(), DL, 1, VInt32VT);
@@ -138,6 +139,11 @@ TEST_F(SelectionDAGPatternMatchTest, matchVecShuffle) {
138139
m_ShuffleSpecificMask(m_Value(), m_Value(), MaskData)));
139140
EXPECT_TRUE(std::equal(MaskData.begin(), MaskData.end(), CapturedMask.begin(),
140141
CapturedMask.end()));
142+
EXPECT_FALSE(
143+
sd_match(VecShuffleWithMask,
144+
m_ShuffleSpecificMask(m_Value(), m_Value(), otherMaskData)));
145+
EXPECT_FALSE(std::equal(otherMaskData.begin(), otherMaskData.end(),
146+
CapturedMask.begin(), CapturedMask.end()));
141147
}
142148

143149
TEST_F(SelectionDAGPatternMatchTest, matchTernaryOp) {

0 commit comments

Comments
 (0)