summaryrefslogtreecommitdiff
path: root/unittests/ADT/APInt.cpp
blob: 5bca5b6b4063c1b2b4619e1cf6bfd981fa31bc71 (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
//===- llvm/unittest/ADT/APInt.cpp - APInt unit tests -----------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "gtest/gtest.h"
#include "llvm/ADT/APInt.h"

using namespace llvm;

namespace {

// Test that APInt shift left works when bitwidth > 64 and shiftamt == 0
TEST(APIntTest, ShiftLeftByZero) {
  APInt One = APInt::getNullValue(65) + 1;
  APInt Shl = One.shl(0);
  EXPECT_EQ(Shl[0], true);
  EXPECT_EQ(Shl[1], false);
}

}