diff options
Diffstat (limited to 'unittests/ADT/APInt.cpp')
-rw-r--r-- | unittests/ADT/APInt.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/unittests/ADT/APInt.cpp b/unittests/ADT/APInt.cpp new file mode 100644 index 0000000..5bca5b6 --- /dev/null +++ b/unittests/ADT/APInt.cpp @@ -0,0 +1,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); +} + +} |