summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/tools
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2018-06-13 13:53:56 +0000
committerGuillaume Chatelet <gchatelet@google.com>2018-06-13 13:53:56 +0000
commit60e3d582f664486507119dc2b7fc3a876b065664 (patch)
treeac00c0cb2c7c054e9e3ce29c8850b3960d7522b8 /llvm/unittests/tools
parent3e039f86cccf39e18161cac86940a7c78563dcc4 (diff)
downloadbcm5719-llvm-60e3d582f664486507119dc2b7fc3a876b065664.tar.gz
bcm5719-llvm-60e3d582f664486507119dc2b7fc3a876b065664.zip
[llvm-exegesis] Fix failing assert when creating Snippet for LAHF.
Reviewers: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48123 llvm-svn: 334599
Diffstat (limited to 'llvm/unittests/tools')
-rw-r--r--llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp b/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
index 0e4a3fb8f17..d020d4cf309 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
@@ -103,11 +103,22 @@ TEST_F(LatencySnippetGeneratorTest, DependencyThroughOtherOpcode) {
const unsigned Opcode = llvm::X86::CMP64rr;
auto Conf = checkAndGetConfiguration(Opcode);
- EXPECT_THAT(Conf.Info, testing::HasSubstr("cycle through CMOVLE16rr"));
+ EXPECT_THAT(Conf.Info, testing::HasSubstr("cycle through"));
ASSERT_THAT(Conf.Snippet, testing::SizeIs(2));
+ const llvm::MCInst Instr = Conf.Snippet[0];
+ EXPECT_THAT(Instr.getOpcode(), Opcode);
// TODO: check that the two instructions alias each other.
}
+TEST_F(LatencySnippetGeneratorTest, LAHF) {
+ const unsigned Opcode = llvm::X86::LAHF;
+ auto Conf = checkAndGetConfiguration(Opcode);
+ EXPECT_THAT(Conf.Info, testing::HasSubstr("cycle through"));
+ ASSERT_THAT(Conf.Snippet, testing::SizeIs(2));
+ const llvm::MCInst Instr = Conf.Snippet[0];
+ EXPECT_THAT(Instr.getOpcode(), Opcode);
+}
+
class UopsSnippetGeneratorTest : public X86SnippetGeneratorTest {
protected:
UopsSnippetGeneratorTest() : Runner(State) {}
OpenPOWER on IntegriCloud