[llvm] [RISCV][llvm-exegesis] Add unittests. NFC (PR #121862)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 21:52:11 PST 2025


================
@@ -0,0 +1,62 @@
+//===-- TargetTest.cpp ---------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Target.h"
+
+#include <cassert>
+#include <memory>
+
+#include "MCTargetDesc/RISCVMCTargetDesc.h"
+#include "llvm/MC/TargetRegistry.h"
+#include "llvm/Support/TargetSelect.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+namespace llvm{
+namespace exegesis {
+
+void InitializeRISCVExegesisTarget();
+
+namespace {
+
+using testing::NotNull;
+using testing::IsEmpty;
+using testing::Not;
+
+constexpr const char kTriple[] = "riscv64-unknown-linux";
+
+class RISCVTargetTest : public ::testing::Test {
----------------
boomanaiden154 wrote:

I think we should probably prefer inheriting from the test base class. I'll send a patch to make the others consistent.

https://github.com/llvm/llvm-project/pull/121862


More information about the llvm-commits mailing list