Nick Lewycky | 1999ff1 | 2009-01-19 18:08:33 +0000 | [diff] [blame^] | 1 | //===- llvm/unittest/ADT/APInt.cpp - APInt unit tests -----------*- 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 | #include "gtest/gtest.h" |
| 11 | #include "llvm/ADT/APInt.h" |
| 12 | |
| 13 | using namespace llvm; |
| 14 | |
| 15 | namespace { |
| 16 | |
| 17 | // Test that APInt shift left works when bitwidth > 64 and shiftamt == 0 |
| 18 | TEST(APIntTest, ShiftLeftByZero) { |
| 19 | APInt One = APInt::getNullValue(65) + 1; |
| 20 | APInt Shl = One.shl(0); |
| 21 | EXPECT_EQ(Shl[0], true); |
| 22 | EXPECT_EQ(Shl[1], false); |
| 23 | } |
| 24 | |
| 25 | } |