1 //===-- PerfHelperTest.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 "PerfHelper.h"
10 #include "llvm/Config/config.h"
11 #include "gmock/gmock.h"
12 #include "gtest/gtest.h"
19 using ::testing::IsEmpty
;
22 TEST(PerfHelperTest
, FunctionalTest
) {
24 ASSERT_FALSE(pfmInitialize());
25 PerfEvent
Event("CYCLES:u");
26 ASSERT_TRUE(Event
.valid());
27 EXPECT_EQ(Event
.name(), "CYCLES:u");
28 EXPECT_THAT(Event
.getPfmEventString(), Not(IsEmpty()));
29 Counter
Cnt(std::move(Event
));
35 ASSERT_TRUE(pfmInitialize());
41 } // namespace exegesis