blob: 5bca5b6b4063c1b2b4619e1cf6bfd981fa31bc71 [file] [log] [blame]
Nick Lewycky1999ff12009-01-19 18:08:33 +00001//===- 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
13using namespace llvm;
14
15namespace {
16
17// Test that APInt shift left works when bitwidth > 64 and shiftamt == 0
18TEST(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}