aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp')
-rw-r--r--llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp b/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp
index 172eca4..6a54084 100644
--- a/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp
@@ -137,6 +137,14 @@ TEST_F(AArch64GISelMITest, MatchBinaryOp) {
EXPECT_TRUE(match);
EXPECT_EQ(Src0, Copies[0]);
EXPECT_EQ(Src1, TruncCopy1.getReg(0));
+
+ // Match shl, and make sure a different shift amount type works.
+ auto Shl = B.buildShl(s64, Copies[0], TruncCopy1);
+ match = mi_match(Shl.getReg(0), *MRI,
+ m_GShl(m_Reg(Src0), m_Reg(Src1)));
+ EXPECT_TRUE(match);
+ EXPECT_EQ(Src0, Copies[0]);
+ EXPECT_EQ(Src1, TruncCopy1.getReg(0));
}
TEST_F(AArch64GISelMITest, MatchICmp) {