[docs] Fix build-docs.sh
[llvm-project.git] / llvm / unittests / DebugInfo / DWARF / DWARFLocationExpressionTest.cpp
blobfb1dc3bd280a9c1fff202d8d6b52a6c0e9367903
1 //===- llvm/unittest/DebugInfo/DWARFLocationExpressionTest.cpp ------------===//
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "llvm/DebugInfo/DWARF/DWARFLocationExpression.h"
10 #include "llvm/Support/ScopedPrinter.h"
11 #include "gtest/gtest.h"
13 using namespace llvm;
14 using object::SectionedAddress;
16 TEST(DWARFLocationExpression, Equality) {
17 EXPECT_EQ((DWARFLocationExpression{None, {}}),
18 (DWARFLocationExpression{None, {}}));
19 EXPECT_NE((DWARFLocationExpression{DWARFAddressRange{1, 47}, {}}),
20 (DWARFLocationExpression{DWARFAddressRange{1, 48}, {}}));
21 EXPECT_NE((DWARFLocationExpression{DWARFAddressRange{1, 47}, {}}),
22 (DWARFLocationExpression{DWARFAddressRange{1, 47}, {42}}));
25 TEST(DWARFLocationExpression, StreamingOperator) {
26 EXPECT_EQ("None: 1, 2", to_string(DWARFLocationExpression{None, {1, 2}}));
27 EXPECT_EQ(
28 "[0x0000000000000042, 0x0000000000000047): 1",
29 to_string(DWARFLocationExpression{DWARFAddressRange{0x42, 0x47}, {1}}));