1 //===-- AssemblerTest.cpp ---------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #include "../Common/AssemblerUtils.h"
10 #include "X86InstrInfo.h"
15 void InitializeX86ExegesisTarget();
25 class X86MachineFunctionGeneratorTest
26 : public MachineFunctionGeneratorBaseTest
{
28 X86MachineFunctionGeneratorTest()
29 : MachineFunctionGeneratorBaseTest("x86_64-unknown-linux", "haswell") {}
31 static void SetUpTestCase() {
32 LLVMInitializeX86TargetInfo();
33 LLVMInitializeX86TargetMC();
34 LLVMInitializeX86Target();
35 LLVMInitializeX86AsmPrinter();
36 InitializeX86ExegesisTarget();
40 TEST_F(X86MachineFunctionGeneratorTest
, DISABLED_JitFunction
) {
41 Check({}, MCInst(), 0xc3);
44 TEST_F(X86MachineFunctionGeneratorTest
, DISABLED_JitFunctionXOR32rr_X86
) {
45 Check({{EAX
, APInt(32, 1)}},
46 MCInstBuilder(XOR32rr
).addReg(EAX
).addReg(EAX
).addReg(EAX
),
48 0xb8, 0x01, 0x00, 0x00, 0x00,
53 TEST_F(X86MachineFunctionGeneratorTest
, DISABLED_JitFunctionMOV64ri
) {
54 Check({}, MCInstBuilder(MOV64ri32
).addReg(RAX
).addImm(42), 0x48, 0xc7, 0xc0,
55 0x2a, 0x00, 0x00, 0x00, 0xc3);
58 TEST_F(X86MachineFunctionGeneratorTest
, DISABLED_JitFunctionMOV32ri
) {
59 Check({}, MCInstBuilder(MOV32ri
).addReg(EAX
).addImm(42), 0xb8, 0x2a, 0x00,
64 } // namespace exegesis