Pavel Labath | b625a0e | 2016-02-09 17:28:01 +0000 | [diff] [blame^] | 1 | //===-- 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 | |
| 20 | using namespace lldb_private; |
| 21 | |
| 22 | TEST(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 | } |