[MIPS GlobalISel] Select MSA vector generic and builtin add
[llvm-complete.git] / utils / benchmark / test / benchmark_gtest.cc
blob10683b433ab54aa417eccb660907c34657da42e7
1 #include <vector>
3 #include "../src/benchmark_register.h"
4 #include "gmock/gmock.h"
5 #include "gtest/gtest.h"
7 namespace {
9 TEST(AddRangeTest, Simple) {
10 std::vector<int> dst;
11 AddRange(&dst, 1, 2, 2);
12 EXPECT_THAT(dst, testing::ElementsAre(1, 2));
15 TEST(AddRangeTest, Simple64) {
16 std::vector<int64_t> dst;
17 AddRange(&dst, static_cast<int64_t>(1), static_cast<int64_t>(2), 2);
18 EXPECT_THAT(dst, testing::ElementsAre(1, 2));
21 TEST(AddRangeTest, Advanced) {
22 std::vector<int> dst;
23 AddRange(&dst, 5, 15, 2);
24 EXPECT_THAT(dst, testing::ElementsAre(5, 8, 15));
27 TEST(AddRangeTest, Advanced64) {
28 std::vector<int64_t> dst;
29 AddRange(&dst, static_cast<int64_t>(5), static_cast<int64_t>(15), 2);
30 EXPECT_THAT(dst, testing::ElementsAre(5, 8, 15));
33 } // end namespace