brintos

brintos / llvm-project-archived public Read only

0
0
Text · 955 B · 7866314 Raw
29 lines · cpp
1//===- COFFObjectFileTest.cpp - Tests for COFFObjectFile ----------------===//2//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-exception6//7//===----------------------------------------------------------------------===//8 9#include "llvm/Object/COFF.h"10#include "gtest/gtest.h"11 12using namespace llvm::object;13 14TEST(COFFObjectFileTest, CHPERangeEntry) {15  chpe_range_entry range;16 17  range.StartOffset = 0x1000;18  EXPECT_EQ(range.getStart(), 0x1000u);19  EXPECT_EQ(range.getType(), chpe_range_type::Arm64);20 21  range.StartOffset = 0x2000 | chpe_range_type::Arm64EC;22  EXPECT_EQ(range.getStart(), 0x2000u);23  EXPECT_EQ(range.getType(), chpe_range_type::Arm64EC);24 25  range.StartOffset = 0x3000 | chpe_range_type::Amd64;26  EXPECT_EQ(range.getStart(), 0x3000u);27  EXPECT_EQ(range.getType(), chpe_range_type::Amd64);28}29