summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Core/ScalarTest.cpp
blob: 63c0daa424e54c4eac04ffbc612425780faa286d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//===-- ScalarTest.cpp ------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#if defined(_MSC_VER) && (_HAS_EXCEPTIONS == 0)
// Workaround for MSVC standard library bug, which fails to include <thread> when
// exceptions are disabled.
#include <eh.h>
#endif

#include "gtest/gtest.h"

#include "lldb/Core/Scalar.h"

using namespace lldb_private;

TEST(ScalarTest, RightShiftOperator)
{
    int a = 0x00001000;
    int b = 0xFFFFFFFF;
    int c = 4;
    Scalar a_scalar(a);
    Scalar b_scalar(b);
    Scalar c_scalar(c);
    ASSERT_EQ(a >> c, a_scalar >> c_scalar);
    ASSERT_EQ(b >> c, b_scalar >> c_scalar);
}
OpenPOWER on IntegriCloud