diff options
author | Clement Courbet <courbet@google.com> | 2018-05-17 10:52:18 +0000 |
---|---|---|
committer | Clement Courbet <courbet@google.com> | 2018-05-17 10:52:18 +0000 |
commit | 0e69e2d74739a119a78d131c29b92c25787ec2f3 (patch) | |
tree | c808110b4a710daf2bed231cc96e1e3af1558294 /llvm/unittests/tools/llvm-exegesis/ARM/AssemblerTest.cpp | |
parent | ceb4933dc1dc4e769ea9e1752a8cb8425de09002 (diff) | |
download | bcm5719-llvm-0e69e2d74739a119a78d131c29b92c25787ec2f3.tar.gz bcm5719-llvm-0e69e2d74739a119a78d131c29b92c25787ec2f3.zip |
reland r332579: [llvm-exegesis] Update to cover latency through another opcode.
Restructuring the code to measure latency and uops.
The end goal is to have this program spawn another process to deal with SIGILL and other malformed programs. It is not yet the case in this redesign, it is still the main program that runs the code (and may crash).
It now uses BitVector instead of Graph for performance reasons.
https://reviews.llvm.org/D46821
(with fixed ARM tests)
Authored by Guillaume Chatelet
llvm-svn: 332592
Diffstat (limited to 'llvm/unittests/tools/llvm-exegesis/ARM/AssemblerTest.cpp')
-rw-r--r-- | llvm/unittests/tools/llvm-exegesis/ARM/AssemblerTest.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/llvm/unittests/tools/llvm-exegesis/ARM/AssemblerTest.cpp b/llvm/unittests/tools/llvm-exegesis/ARM/AssemblerTest.cpp new file mode 100644 index 00000000000..e3da703a88e --- /dev/null +++ b/llvm/unittests/tools/llvm-exegesis/ARM/AssemblerTest.cpp @@ -0,0 +1,48 @@ +//===-- AssemblerTest.cpp ---------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "../Common/AssemblerUtils.h" +#include "ARMInstrInfo.h" + +namespace exegesis { +namespace { + +using llvm::MCInstBuilder; + +class ARMMachineFunctionGeneratorTest + : public MachineFunctionGeneratorBaseTest { +protected: + ARMMachineFunctionGeneratorTest() + : MachineFunctionGeneratorBaseTest("armv7-none-linux-gnueabi", "") {} + + static void SetUpTestCase() { + LLVMInitializeARMTargetInfo(); + LLVMInitializeARMTargetMC(); + LLVMInitializeARMTarget(); + LLVMInitializeARMAsmPrinter(); + } +}; + +TEST_F(ARMMachineFunctionGeneratorTest, JitFunction) { + Check(llvm::MCInst(), 0x1e, 0xff, 0x2f, 0xe1); +} + +TEST_F(ARMMachineFunctionGeneratorTest, JitFunctionADDrr) { + Check(MCInstBuilder(llvm::ARM::ADDrr) + .addReg(llvm::ARM::R0) + .addReg(llvm::ARM::R0) + .addReg(llvm::ARM::R0) + .addImm(llvm::ARMCC::AL) + .addReg(0) + .addReg(0), + 0x00, 0x00, 0x80, 0xe0, 0x1e, 0xff, 0x2f, 0xe1); +} + +} // namespace +} // namespace exegesis |