1 //===- COFFObjectFileTest.cpp - Tests for COFFObjectFile ----------------===//
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 "llvm/Object/COFF.h"
10 #include "gtest/gtest.h"
12 using namespace llvm::object
;
14 TEST(COFFObjectFileTest
, CHPERangeEntry
) {
15 chpe_range_entry range
;
17 range
.StartOffset
= 0x1000;
18 EXPECT_EQ(range
.getStart(), 0x1000u
);
19 EXPECT_EQ(range
.getType(), chpe_range_type::Arm64
);
21 range
.StartOffset
= 0x2000 | chpe_range_type::Arm64EC
;
22 EXPECT_EQ(range
.getStart(), 0x2000u
);
23 EXPECT_EQ(range
.getType(), chpe_range_type::Arm64EC
);
25 range
.StartOffset
= 0x3000 | chpe_range_type::Amd64
;
26 EXPECT_EQ(range
.getStart(), 0x3000u
);
27 EXPECT_EQ(range
.getType(), chpe_range_type::Amd64
);