Improve Register Setup
[llvm-core.git] / unittests / Object / SymbolSizeTest.cpp
blobad9c40b986db56da5132f84c24d0e54f8c51909e
1 //===- SymbolSizeTest.cpp - Tests for SymbolSize.cpp ----------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #include "llvm/Object/SymbolSize.h"
11 #include "gtest/gtest.h"
13 using namespace llvm;
14 using namespace llvm::object;
16 TEST(Object, SymbolSizeSort) {
17 auto it = symbol_iterator(SymbolRef());
18 std::vector<SymEntry> Syms{
19 SymEntry{it, 0xffffffff00000000ull, 1, 0},
20 SymEntry{it, 0x00ffffff00000000ull, 2, 0},
21 SymEntry{it, 0x00ffffff000000ffull, 3, 0},
22 SymEntry{it, 0x0000000100000000ull, 4, 0},
23 SymEntry{it, 0x00000000000000ffull, 5, 0},
24 SymEntry{it, 0x00000001000000ffull, 6, 0},
25 SymEntry{it, 0x000000010000ffffull, 7, 0},
28 array_pod_sort(Syms.begin(), Syms.end(), compareAddress);
30 for (unsigned I = 0, N = Syms.size(); I < N - 1; ++I) {
31 EXPECT_LE(Syms[I].Address, Syms[I + 1].Address);