Lines Matching refs:APSInt

18   APSInt A(32, true);  in TEST()
21 APSInt B(128, false); in TEST()
25 APSInt C(B); in TEST()
30 APSInt D(std::move(Wide)); in TEST()
34 A = APSInt(64, true); in TEST()
45 EXPECT_TRUE(APSInt::get(7).isSigned()); in TEST()
46 EXPECT_EQ(64u, APSInt::get(7).getBitWidth()); in TEST()
47 EXPECT_EQ(7u, APSInt::get(7).getZExtValue()); in TEST()
48 EXPECT_EQ(7, APSInt::get(7).getSExtValue()); in TEST()
49 EXPECT_TRUE(APSInt::get(-7).isSigned()); in TEST()
50 EXPECT_EQ(64u, APSInt::get(-7).getBitWidth()); in TEST()
51 EXPECT_EQ(-7, APSInt::get(-7).getSExtValue()); in TEST()
52 EXPECT_EQ(UINT64_C(0) - 7, APSInt::get(-7).getZExtValue()); in TEST()
56 EXPECT_TRUE(APSInt::getUnsigned(7).isUnsigned()); in TEST()
57 EXPECT_EQ(64u, APSInt::getUnsigned(7).getBitWidth()); in TEST()
58 EXPECT_EQ(7u, APSInt::getUnsigned(7).getZExtValue()); in TEST()
59 EXPECT_EQ(7, APSInt::getUnsigned(7).getSExtValue()); in TEST()
60 EXPECT_TRUE(APSInt::getUnsigned(-7).isUnsigned()); in TEST()
61 EXPECT_EQ(64u, APSInt::getUnsigned(-7).getBitWidth()); in TEST()
62 EXPECT_EQ(-7, APSInt::getUnsigned(-7).getSExtValue()); in TEST()
63 EXPECT_EQ(UINT64_C(0) - 7, APSInt::getUnsigned(-7).getZExtValue()); in TEST()
67 EXPECT_TRUE(APSInt(APInt(3, 7), true).isUnsigned()); in TEST()
68 EXPECT_TRUE(APSInt(APInt(3, 7), false).isSigned()); in TEST()
69 EXPECT_TRUE(APSInt(APInt(4, 7), true).isUnsigned()); in TEST()
70 EXPECT_TRUE(APSInt(APInt(4, 7), false).isSigned()); in TEST()
71 EXPECT_TRUE(APSInt(APInt(4, -7), true).isUnsigned()); in TEST()
72 EXPECT_TRUE(APSInt(APInt(4, -7), false).isSigned()); in TEST()
73 EXPECT_EQ(7, APSInt(APInt(3, 7), true).getExtValue()); in TEST()
74 EXPECT_EQ(-1, APSInt(APInt(3, 7), false).getExtValue()); in TEST()
75 EXPECT_EQ(7, APSInt(APInt(4, 7), true).getExtValue()); in TEST()
76 EXPECT_EQ(7, APSInt(APInt(4, 7), false).getExtValue()); in TEST()
77 EXPECT_EQ(9, APSInt(APInt(4, -7), true).getExtValue()); in TEST()
78 EXPECT_EQ(-7, APSInt(APInt(4, -7), false).getExtValue()); in TEST()
82 auto U = [](uint64_t V) { return APSInt::getUnsigned(V); }; in TEST()
83 auto S = [](int64_t V) { return APSInt::get(V); }; in TEST()
86 EXPECT_TRUE(APSInt::compareValues(S(7), S(8)) < 0); in TEST()
87 EXPECT_TRUE(APSInt::compareValues(S(8), S(7)) > 0); in TEST()
88 EXPECT_TRUE(APSInt::compareValues(S(7), S(7)) == 0); in TEST()
89 EXPECT_TRUE(APSInt::compareValues(S(-7), S(8)) < 0); in TEST()
90 EXPECT_TRUE(APSInt::compareValues(S(8), S(-7)) > 0); in TEST()
91 EXPECT_TRUE(APSInt::compareValues(S(-7), S(-7)) == 0); in TEST()
92 EXPECT_TRUE(APSInt::compareValues(S(-7), S(-8)) > 0); in TEST()
93 EXPECT_TRUE(APSInt::compareValues(S(-8), S(-7)) < 0); in TEST()
94 EXPECT_TRUE(APSInt::compareValues(S(-7), S(-7)) == 0); in TEST()
97 EXPECT_TRUE(APSInt::compareValues(U(7), U(8)) < 0); in TEST()
98 EXPECT_TRUE(APSInt::compareValues(U(8), U(7)) > 0); in TEST()
99 EXPECT_TRUE(APSInt::compareValues(U(7), U(7)) == 0); in TEST()
102 EXPECT_TRUE(APSInt::compareValues(U(7), S(8)) < 0); in TEST()
103 EXPECT_TRUE(APSInt::compareValues(U(8), S(7)) > 0); in TEST()
104 EXPECT_TRUE(APSInt::compareValues(U(7), S(7)) == 0); in TEST()
105 EXPECT_TRUE(APSInt::compareValues(U(8), S(-7)) > 0); in TEST()
108 EXPECT_TRUE(APSInt::compareValues(S(7).trunc(32), S(8)) < 0); in TEST()
109 EXPECT_TRUE(APSInt::compareValues(S(8).trunc(32), S(7)) > 0); in TEST()
110 EXPECT_TRUE(APSInt::compareValues(S(7).trunc(32), S(7)) == 0); in TEST()
111 EXPECT_TRUE(APSInt::compareValues(S(-7).trunc(32), S(8)) < 0); in TEST()
112 EXPECT_TRUE(APSInt::compareValues(S(8).trunc(32), S(-7)) > 0); in TEST()
113 EXPECT_TRUE(APSInt::compareValues(S(-7).trunc(32), S(-7)) == 0); in TEST()
114 EXPECT_TRUE(APSInt::compareValues(S(-7).trunc(32), S(-8)) > 0); in TEST()
115 EXPECT_TRUE(APSInt::compareValues(S(-8).trunc(32), S(-7)) < 0); in TEST()
116 EXPECT_TRUE(APSInt::compareValues(S(-7).trunc(32), S(-7)) == 0); in TEST()
117 EXPECT_TRUE(APSInt::compareValues(S(7), S(8).trunc(32)) < 0); in TEST()
118 EXPECT_TRUE(APSInt::compareValues(S(8), S(7).trunc(32)) > 0); in TEST()
119 EXPECT_TRUE(APSInt::compareValues(S(7), S(7).trunc(32)) == 0); in TEST()
120 EXPECT_TRUE(APSInt::compareValues(S(-7), S(8).trunc(32)) < 0); in TEST()
121 EXPECT_TRUE(APSInt::compareValues(S(8), S(-7).trunc(32)) > 0); in TEST()
122 EXPECT_TRUE(APSInt::compareValues(S(-7), S(-7).trunc(32)) == 0); in TEST()
123 EXPECT_TRUE(APSInt::compareValues(S(-7), S(-8).trunc(32)) > 0); in TEST()
124 EXPECT_TRUE(APSInt::compareValues(S(-8), S(-7).trunc(32)) < 0); in TEST()
125 EXPECT_TRUE(APSInt::compareValues(S(-7), S(-7).trunc(32)) == 0); in TEST()
128 EXPECT_TRUE(APSInt::compareValues(U(7), U(8).trunc(32)) < 0); in TEST()
129 EXPECT_TRUE(APSInt::compareValues(U(8), U(7).trunc(32)) > 0); in TEST()
130 EXPECT_TRUE(APSInt::compareValues(U(7), U(7).trunc(32)) == 0); in TEST()
131 EXPECT_TRUE(APSInt::compareValues(U(7).trunc(32), U(8)) < 0); in TEST()
132 EXPECT_TRUE(APSInt::compareValues(U(8).trunc(32), U(7)) > 0); in TEST()
133 EXPECT_TRUE(APSInt::compareValues(U(7).trunc(32), U(7)) == 0); in TEST()
136 EXPECT_TRUE(APSInt::compareValues(U(7).trunc(32), S(8)) < 0); in TEST()
137 EXPECT_TRUE(APSInt::compareValues(U(8).trunc(32), S(7)) > 0); in TEST()
138 EXPECT_TRUE(APSInt::compareValues(U(7).trunc(32), S(7)) == 0); in TEST()
139 EXPECT_TRUE(APSInt::compareValues(U(8).trunc(32), S(-7)) > 0); in TEST()
140 EXPECT_TRUE(APSInt::compareValues(U(7), S(8).trunc(32)) < 0); in TEST()
141 EXPECT_TRUE(APSInt::compareValues(U(8), S(7).trunc(32)) > 0); in TEST()
142 EXPECT_TRUE(APSInt::compareValues(U(7), S(7).trunc(32)) == 0); in TEST()
143 EXPECT_TRUE(APSInt::compareValues(U(8), S(-7).trunc(32)) > 0); in TEST()
147 EXPECT_EQ(APSInt("1").getExtValue(), 1); in TEST()
148 EXPECT_EQ(APSInt("-1").getExtValue(), -1); in TEST()
149 EXPECT_EQ(APSInt("0").getExtValue(), 0); in TEST()
150 EXPECT_EQ(APSInt("56789").getExtValue(), 56789); in TEST()
151 EXPECT_EQ(APSInt("-1234").getExtValue(), -1234); in TEST()
157 EXPECT_DEATH(APSInt(""), "Invalid string length"); in TEST()
158 EXPECT_DEATH(APSInt("1a"), "Invalid character in digit string"); in TEST()