5bca5b6b4063c1b2b4619e1cf6bfd981fa31bc71
[oota-llvm.git] / unittests / ADT / APInt.cpp
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 }