Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add operator<< for object::SectionedAddress
The main motivation for this is better failure messages in unit tests. Split off from D70394.
- Loading branch information
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//===- ObjectFileTest.cpp - Tests for ObjectFile.cpp ----------------------===// | ||
// | ||
// 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 "llvm/Object/ObjectFile.h" | ||
#include "llvm/Support/ScopedPrinter.h" | ||
#include "gtest/gtest.h" | ||
|
||
using namespace llvm; | ||
using namespace llvm::object; | ||
|
||
TEST(SectionedAddress, StreamingOperator) { | ||
EXPECT_EQ("SectionedAddress{0x00000047}", to_string(SectionedAddress{0x47})); | ||
EXPECT_EQ("SectionedAddress{0x00000047, 42}", | ||
to_string(SectionedAddress{0x47, 42})); | ||
} |