1 //===- llvm/unittest/ADT/APSIntTest.cpp - APSInt unit tests ---------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/ADT/APSInt.h"
11 #include "gtest/gtest.h"
17 TEST(APSIntTest, MoveTest) {
19 EXPECT_TRUE(A.isUnsigned());
23 EXPECT_FALSE(A.isUnsigned());
26 EXPECT_FALSE(C.isUnsigned());
29 const uint64_t *Bits = Wide.getRawData();
30 APSInt D(std::move(Wide));
31 EXPECT_TRUE(D.isUnsigned());
32 EXPECT_EQ(Bits, D.getRawData()); // Verify that "Wide" was really moved.
35 EXPECT_TRUE(A.isUnsigned());
38 Bits = Wide.getRawData();
40 EXPECT_TRUE(A.isUnsigned());
41 EXPECT_EQ(Bits, A.getRawData()); // Verify that "Wide" was really moved.