aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2020-03-29 13:07:43 -0400
committerMatt Arsenault <arsenm2@gmail.com>2020-03-29 14:03:07 -0400
commitcce3d96bcc6585e5f134fc093ec50813659c5c5e (patch)
treea249884ab5ae0675a1c6930b1f11b090bf775a15 /llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp
parentd15723ef06508b6b257279fda31fad0fcec8c686 (diff)
downloadllvm-cce3d96bcc6585e5f134fc093ec50813659c5c5e.zip
llvm-cce3d96bcc6585e5f134fc093ec50813659c5c5e.tar.gz
llvm-cce3d96bcc6585e5f134fc093ec50813659c5c5e.tar.bz2
GlobalISel: Add matcher for G_SHL
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) {