blob: 63c0daa424e54c4eac04ffbc612425780faa286d [file] [log] [blame]
Pavel Labathb625a0e2016-02-09 17:28:01 +00001//===-- ScalarTest.cpp ------------------------------------------*- C++ -*-===//
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//===----------------------------------------------------------------------===//
9
10#if defined(_MSC_VER) && (_HAS_EXCEPTIONS == 0)
11// Workaround for MSVC standard library bug, which fails to include <thread> when
12// exceptions are disabled.
13#include <eh.h>
14#endif
15
16#include "gtest/gtest.h"
17
18#include "lldb/Core/Scalar.h"
19
20using namespace lldb_private;
21
22TEST(ScalarTest, RightShiftOperator)
23{
24 int a = 0x00001000;
25 int b = 0xFFFFFFFF;
26 int c = 4;
27 Scalar a_scalar(a);
28 Scalar b_scalar(b);
29 Scalar c_scalar(c);
30 ASSERT_EQ(a >> c, a_scalar >> c_scalar);
31 ASSERT_EQ(b >> c, b_scalar >> c_scalar);
32}