[ARM] MVE predicate store patterns
[llvm-complete.git] / unittests / tools / llvm-exegesis / X86 / AssemblerTest.cpp
blobce7d9be663c517259fda00d98cb160c5860170dd
1 //===-- AssemblerTest.cpp ---------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "../Common/AssemblerUtils.h"
10 #include "X86InstrInfo.h"
12 namespace llvm {
13 namespace exegesis {
15 void InitializeX86ExegesisTarget();
17 namespace {
19 using llvm::MCInstBuilder;
20 using llvm::X86::EAX;
21 using llvm::X86::MOV32ri;
22 using llvm::X86::MOV64ri32;
23 using llvm::X86::RAX;
24 using llvm::X86::XOR32rr;
26 class X86MachineFunctionGeneratorTest
27 : public MachineFunctionGeneratorBaseTest {
28 protected:
29 X86MachineFunctionGeneratorTest()
30 : MachineFunctionGeneratorBaseTest("x86_64-unknown-linux", "haswell") {}
32 static void SetUpTestCase() {
33 LLVMInitializeX86TargetInfo();
34 LLVMInitializeX86TargetMC();
35 LLVMInitializeX86Target();
36 LLVMInitializeX86AsmPrinter();
37 InitializeX86ExegesisTarget();
41 TEST_F(X86MachineFunctionGeneratorTest, DISABLED_JitFunction) {
42 Check({}, llvm::MCInst(), 0xc3);
45 TEST_F(X86MachineFunctionGeneratorTest, DISABLED_JitFunctionXOR32rr_X86) {
46 Check({{EAX, llvm::APInt(32, 1)}},
47 MCInstBuilder(XOR32rr).addReg(EAX).addReg(EAX).addReg(EAX),
48 // mov eax, 1
49 0xb8, 0x01, 0x00, 0x00, 0x00,
50 // xor eax, eax
51 0x31, 0xc0, 0xc3);
54 TEST_F(X86MachineFunctionGeneratorTest, DISABLED_JitFunctionMOV64ri) {
55 Check({}, MCInstBuilder(MOV64ri32).addReg(RAX).addImm(42), 0x48, 0xc7, 0xc0,
56 0x2a, 0x00, 0x00, 0x00, 0xc3);
59 TEST_F(X86MachineFunctionGeneratorTest, DISABLED_JitFunctionMOV32ri) {
60 Check({}, MCInstBuilder(MOV32ri).addReg(EAX).addImm(42), 0xb8, 0x2a, 0x00,
61 0x00, 0x00, 0xc3);
64 } // namespace
65 } // namespace exegesis
66 } // namespace llvm