Elliott Hughes | 2faa5f1 | 2012-01-30 14:42:07 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 16 | |
Elliott Hughes | 90a3369 | 2011-08-30 13:27:07 -0700 | [diff] [blame] | 17 | #include "dex_verifier.h" |
| 18 | |
| 19 | #include <stdio.h> |
| 20 | |
| 21 | #include "UniquePtr.h" |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 22 | #include "class_linker.h" |
| 23 | #include "common_test.h" |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 24 | #include "dex_file.h" |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 25 | |
| 26 | namespace art { |
Ian Rogers | d81871c | 2011-10-03 13:57:23 -0700 | [diff] [blame] | 27 | namespace verifier { |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 28 | |
| 29 | class DexVerifierTest : public CommonTest { |
| 30 | protected: |
Elliott Hughes | 1bac54f | 2012-03-16 12:48:31 -0700 | [diff] [blame] | 31 | void VerifyClass(const std::string& descriptor) { |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 32 | ASSERT_TRUE(descriptor != NULL); |
Elliott Hughes | c3b77c7 | 2011-12-15 20:56:48 -0800 | [diff] [blame] | 33 | Class* klass = class_linker_->FindSystemClass(descriptor.c_str()); |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 34 | |
| 35 | // Verify the class |
Ian Rogers | 1c5eb70 | 2012-02-01 09:18:34 -0800 | [diff] [blame] | 36 | std::string error_msg; |
| 37 | ASSERT_TRUE(DexVerifier::VerifyClass(klass, error_msg)) << error_msg; |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 38 | } |
| 39 | |
Elliott Hughes | 1bac54f | 2012-03-16 12:48:31 -0700 | [diff] [blame] | 40 | void VerifyDexFile(const DexFile* dex) { |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 41 | ASSERT_TRUE(dex != NULL); |
| 42 | |
| 43 | // Verify all the classes defined in this file |
| 44 | for (size_t i = 0; i < dex->NumClassDefs(); i++) { |
| 45 | const DexFile::ClassDef& class_def = dex->GetClassDef(i); |
| 46 | const char* descriptor = dex->GetClassDescriptor(class_def); |
Elliott Hughes | 1bac54f | 2012-03-16 12:48:31 -0700 | [diff] [blame] | 47 | VerifyClass(descriptor); |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 48 | } |
| 49 | } |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | TEST_F(DexVerifierTest, LibCore) { |
Elliott Hughes | 1bac54f | 2012-03-16 12:48:31 -0700 | [diff] [blame] | 53 | VerifyDexFile(java_lang_dex_file_); |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | TEST_F(DexVerifierTest, IntMath) { |
Brian Carlstrom | 40381fb | 2011-10-19 14:13:40 -0700 | [diff] [blame] | 57 | SirtRef<ClassLoader> class_loader(LoadDex("IntMath")); |
| 58 | Class* klass = class_linker_->FindClass("LIntMath;", class_loader.get()); |
Ian Rogers | 1c5eb70 | 2012-02-01 09:18:34 -0800 | [diff] [blame] | 59 | std::string error_msg; |
| 60 | ASSERT_TRUE(DexVerifier::VerifyClass(klass, error_msg)) << error_msg; |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 61 | } |
| 62 | |
Ian Rogers | d81871c | 2011-10-03 13:57:23 -0700 | [diff] [blame] | 63 | TEST_F(DexVerifierTest, RegTypes_Primitives) { |
| 64 | RegTypeCache cache; |
| 65 | |
| 66 | const RegType& bool_reg_type = cache.Boolean(); |
| 67 | EXPECT_FALSE(bool_reg_type.IsUnknown()); |
| 68 | EXPECT_FALSE(bool_reg_type.IsConflict()); |
| 69 | EXPECT_FALSE(bool_reg_type.IsZero()); |
| 70 | EXPECT_FALSE(bool_reg_type.IsOne()); |
Ian Rogers | 84fa074 | 2011-10-25 18:13:30 -0700 | [diff] [blame] | 71 | EXPECT_FALSE(bool_reg_type.IsLongConstant()); |
Ian Rogers | d81871c | 2011-10-03 13:57:23 -0700 | [diff] [blame] | 72 | EXPECT_TRUE(bool_reg_type.IsBoolean()); |
| 73 | EXPECT_FALSE(bool_reg_type.IsByte()); |
| 74 | EXPECT_FALSE(bool_reg_type.IsChar()); |
| 75 | EXPECT_FALSE(bool_reg_type.IsShort()); |
| 76 | EXPECT_FALSE(bool_reg_type.IsInteger()); |
| 77 | EXPECT_FALSE(bool_reg_type.IsLong()); |
| 78 | EXPECT_FALSE(bool_reg_type.IsFloat()); |
| 79 | EXPECT_FALSE(bool_reg_type.IsDouble()); |
| 80 | EXPECT_FALSE(bool_reg_type.IsReference()); |
| 81 | EXPECT_FALSE(bool_reg_type.IsLowHalf()); |
| 82 | EXPECT_FALSE(bool_reg_type.IsHighHalf()); |
| 83 | EXPECT_FALSE(bool_reg_type.IsLongOrDoubleTypes()); |
| 84 | EXPECT_FALSE(bool_reg_type.IsReferenceTypes()); |
| 85 | EXPECT_TRUE(bool_reg_type.IsCategory1Types()); |
| 86 | EXPECT_FALSE(bool_reg_type.IsCategory2Types()); |
| 87 | EXPECT_TRUE(bool_reg_type.IsBooleanTypes()); |
| 88 | EXPECT_TRUE(bool_reg_type.IsByteTypes()); |
| 89 | EXPECT_TRUE(bool_reg_type.IsShortTypes()); |
| 90 | EXPECT_TRUE(bool_reg_type.IsCharTypes()); |
| 91 | EXPECT_TRUE(bool_reg_type.IsIntegralTypes()); |
| 92 | EXPECT_FALSE(bool_reg_type.IsFloatTypes()); |
| 93 | EXPECT_FALSE(bool_reg_type.IsLongTypes()); |
| 94 | EXPECT_FALSE(bool_reg_type.IsDoubleTypes()); |
| 95 | EXPECT_TRUE(bool_reg_type.IsArrayIndexTypes()); |
| 96 | |
| 97 | const RegType& byte_reg_type = cache.Byte(); |
| 98 | EXPECT_FALSE(byte_reg_type.IsUnknown()); |
| 99 | EXPECT_FALSE(byte_reg_type.IsConflict()); |
| 100 | EXPECT_FALSE(byte_reg_type.IsZero()); |
| 101 | EXPECT_FALSE(byte_reg_type.IsOne()); |
Ian Rogers | 84fa074 | 2011-10-25 18:13:30 -0700 | [diff] [blame] | 102 | EXPECT_FALSE(byte_reg_type.IsLongConstant()); |
Ian Rogers | d81871c | 2011-10-03 13:57:23 -0700 | [diff] [blame] | 103 | EXPECT_FALSE(byte_reg_type.IsBoolean()); |
| 104 | EXPECT_TRUE(byte_reg_type.IsByte()); |
| 105 | EXPECT_FALSE(byte_reg_type.IsChar()); |
| 106 | EXPECT_FALSE(byte_reg_type.IsShort()); |
| 107 | EXPECT_FALSE(byte_reg_type.IsInteger()); |
| 108 | EXPECT_FALSE(byte_reg_type.IsLong()); |
| 109 | EXPECT_FALSE(byte_reg_type.IsFloat()); |
| 110 | EXPECT_FALSE(byte_reg_type.IsDouble()); |
| 111 | EXPECT_FALSE(byte_reg_type.IsReference()); |
| 112 | EXPECT_FALSE(byte_reg_type.IsLowHalf()); |
| 113 | EXPECT_FALSE(byte_reg_type.IsHighHalf()); |
| 114 | EXPECT_FALSE(byte_reg_type.IsLongOrDoubleTypes()); |
| 115 | EXPECT_FALSE(byte_reg_type.IsReferenceTypes()); |
| 116 | EXPECT_TRUE(byte_reg_type.IsCategory1Types()); |
| 117 | EXPECT_FALSE(byte_reg_type.IsCategory2Types()); |
| 118 | EXPECT_FALSE(byte_reg_type.IsBooleanTypes()); |
| 119 | EXPECT_TRUE(byte_reg_type.IsByteTypes()); |
| 120 | EXPECT_TRUE(byte_reg_type.IsShortTypes()); |
| 121 | EXPECT_FALSE(byte_reg_type.IsCharTypes()); |
| 122 | EXPECT_TRUE(byte_reg_type.IsIntegralTypes()); |
| 123 | EXPECT_FALSE(byte_reg_type.IsFloatTypes()); |
| 124 | EXPECT_FALSE(byte_reg_type.IsLongTypes()); |
| 125 | EXPECT_FALSE(byte_reg_type.IsDoubleTypes()); |
| 126 | EXPECT_TRUE(byte_reg_type.IsArrayIndexTypes()); |
| 127 | |
| 128 | const RegType& char_reg_type = cache.Char(); |
| 129 | EXPECT_FALSE(char_reg_type.IsUnknown()); |
| 130 | EXPECT_FALSE(char_reg_type.IsConflict()); |
| 131 | EXPECT_FALSE(char_reg_type.IsZero()); |
| 132 | EXPECT_FALSE(char_reg_type.IsOne()); |
Ian Rogers | 84fa074 | 2011-10-25 18:13:30 -0700 | [diff] [blame] | 133 | EXPECT_FALSE(char_reg_type.IsLongConstant()); |
Ian Rogers | d81871c | 2011-10-03 13:57:23 -0700 | [diff] [blame] | 134 | EXPECT_FALSE(char_reg_type.IsBoolean()); |
| 135 | EXPECT_FALSE(char_reg_type.IsByte()); |
| 136 | EXPECT_TRUE(char_reg_type.IsChar()); |
| 137 | EXPECT_FALSE(char_reg_type.IsShort()); |
| 138 | EXPECT_FALSE(char_reg_type.IsInteger()); |
| 139 | EXPECT_FALSE(char_reg_type.IsLong()); |
| 140 | EXPECT_FALSE(char_reg_type.IsFloat()); |
| 141 | EXPECT_FALSE(char_reg_type.IsDouble()); |
| 142 | EXPECT_FALSE(char_reg_type.IsReference()); |
| 143 | EXPECT_FALSE(char_reg_type.IsLowHalf()); |
| 144 | EXPECT_FALSE(char_reg_type.IsHighHalf()); |
| 145 | EXPECT_FALSE(char_reg_type.IsLongOrDoubleTypes()); |
| 146 | EXPECT_FALSE(char_reg_type.IsReferenceTypes()); |
| 147 | EXPECT_TRUE(char_reg_type.IsCategory1Types()); |
| 148 | EXPECT_FALSE(char_reg_type.IsCategory2Types()); |
| 149 | EXPECT_FALSE(char_reg_type.IsBooleanTypes()); |
| 150 | EXPECT_FALSE(char_reg_type.IsByteTypes()); |
| 151 | EXPECT_FALSE(char_reg_type.IsShortTypes()); |
| 152 | EXPECT_TRUE(char_reg_type.IsCharTypes()); |
| 153 | EXPECT_TRUE(char_reg_type.IsIntegralTypes()); |
| 154 | EXPECT_FALSE(char_reg_type.IsFloatTypes()); |
| 155 | EXPECT_FALSE(char_reg_type.IsLongTypes()); |
| 156 | EXPECT_FALSE(char_reg_type.IsDoubleTypes()); |
| 157 | EXPECT_TRUE(char_reg_type.IsArrayIndexTypes()); |
| 158 | |
| 159 | const RegType& short_reg_type = cache.Short(); |
| 160 | EXPECT_FALSE(short_reg_type.IsUnknown()); |
| 161 | EXPECT_FALSE(short_reg_type.IsConflict()); |
| 162 | EXPECT_FALSE(short_reg_type.IsZero()); |
| 163 | EXPECT_FALSE(short_reg_type.IsOne()); |
Ian Rogers | 84fa074 | 2011-10-25 18:13:30 -0700 | [diff] [blame] | 164 | EXPECT_FALSE(short_reg_type.IsLongConstant()); |
Ian Rogers | d81871c | 2011-10-03 13:57:23 -0700 | [diff] [blame] | 165 | EXPECT_FALSE(short_reg_type.IsBoolean()); |
| 166 | EXPECT_FALSE(short_reg_type.IsByte()); |
| 167 | EXPECT_FALSE(short_reg_type.IsChar()); |
| 168 | EXPECT_TRUE(short_reg_type.IsShort()); |
| 169 | EXPECT_FALSE(short_reg_type.IsInteger()); |
| 170 | EXPECT_FALSE(short_reg_type.IsLong()); |
| 171 | EXPECT_FALSE(short_reg_type.IsFloat()); |
| 172 | EXPECT_FALSE(short_reg_type.IsDouble()); |
| 173 | EXPECT_FALSE(short_reg_type.IsReference()); |
| 174 | EXPECT_FALSE(short_reg_type.IsLowHalf()); |
| 175 | EXPECT_FALSE(short_reg_type.IsHighHalf()); |
| 176 | EXPECT_FALSE(short_reg_type.IsLongOrDoubleTypes()); |
| 177 | EXPECT_FALSE(short_reg_type.IsReferenceTypes()); |
| 178 | EXPECT_TRUE(short_reg_type.IsCategory1Types()); |
| 179 | EXPECT_FALSE(short_reg_type.IsCategory2Types()); |
| 180 | EXPECT_FALSE(short_reg_type.IsBooleanTypes()); |
| 181 | EXPECT_FALSE(short_reg_type.IsByteTypes()); |
| 182 | EXPECT_TRUE(short_reg_type.IsShortTypes()); |
| 183 | EXPECT_FALSE(short_reg_type.IsCharTypes()); |
| 184 | EXPECT_TRUE(short_reg_type.IsIntegralTypes()); |
| 185 | EXPECT_FALSE(short_reg_type.IsFloatTypes()); |
| 186 | EXPECT_FALSE(short_reg_type.IsLongTypes()); |
| 187 | EXPECT_FALSE(short_reg_type.IsDoubleTypes()); |
| 188 | EXPECT_TRUE(short_reg_type.IsArrayIndexTypes()); |
| 189 | |
| 190 | const RegType& int_reg_type = cache.Integer(); |
| 191 | EXPECT_FALSE(int_reg_type.IsUnknown()); |
| 192 | EXPECT_FALSE(int_reg_type.IsConflict()); |
| 193 | EXPECT_FALSE(int_reg_type.IsZero()); |
| 194 | EXPECT_FALSE(int_reg_type.IsOne()); |
Ian Rogers | 84fa074 | 2011-10-25 18:13:30 -0700 | [diff] [blame] | 195 | EXPECT_FALSE(int_reg_type.IsLongConstant()); |
Ian Rogers | d81871c | 2011-10-03 13:57:23 -0700 | [diff] [blame] | 196 | EXPECT_FALSE(int_reg_type.IsBoolean()); |
| 197 | EXPECT_FALSE(int_reg_type.IsByte()); |
| 198 | EXPECT_FALSE(int_reg_type.IsChar()); |
| 199 | EXPECT_FALSE(int_reg_type.IsShort()); |
| 200 | EXPECT_TRUE(int_reg_type.IsInteger()); |
| 201 | EXPECT_FALSE(int_reg_type.IsLong()); |
| 202 | EXPECT_FALSE(int_reg_type.IsFloat()); |
| 203 | EXPECT_FALSE(int_reg_type.IsDouble()); |
| 204 | EXPECT_FALSE(int_reg_type.IsReference()); |
| 205 | EXPECT_FALSE(int_reg_type.IsLowHalf()); |
| 206 | EXPECT_FALSE(int_reg_type.IsHighHalf()); |
| 207 | EXPECT_FALSE(int_reg_type.IsLongOrDoubleTypes()); |
| 208 | EXPECT_FALSE(int_reg_type.IsReferenceTypes()); |
| 209 | EXPECT_TRUE(int_reg_type.IsCategory1Types()); |
| 210 | EXPECT_FALSE(int_reg_type.IsCategory2Types()); |
| 211 | EXPECT_FALSE(int_reg_type.IsBooleanTypes()); |
| 212 | EXPECT_FALSE(int_reg_type.IsByteTypes()); |
| 213 | EXPECT_FALSE(int_reg_type.IsShortTypes()); |
| 214 | EXPECT_FALSE(int_reg_type.IsCharTypes()); |
| 215 | EXPECT_TRUE(int_reg_type.IsIntegralTypes()); |
| 216 | EXPECT_FALSE(int_reg_type.IsFloatTypes()); |
| 217 | EXPECT_FALSE(int_reg_type.IsLongTypes()); |
| 218 | EXPECT_FALSE(int_reg_type.IsDoubleTypes()); |
| 219 | EXPECT_TRUE(int_reg_type.IsArrayIndexTypes()); |
| 220 | |
| 221 | const RegType& long_reg_type = cache.Long(); |
| 222 | EXPECT_FALSE(long_reg_type.IsUnknown()); |
| 223 | EXPECT_FALSE(long_reg_type.IsConflict()); |
| 224 | EXPECT_FALSE(long_reg_type.IsZero()); |
| 225 | EXPECT_FALSE(long_reg_type.IsOne()); |
Ian Rogers | 84fa074 | 2011-10-25 18:13:30 -0700 | [diff] [blame] | 226 | EXPECT_FALSE(long_reg_type.IsLongConstant()); |
Ian Rogers | d81871c | 2011-10-03 13:57:23 -0700 | [diff] [blame] | 227 | EXPECT_FALSE(long_reg_type.IsBoolean()); |
| 228 | EXPECT_FALSE(long_reg_type.IsByte()); |
| 229 | EXPECT_FALSE(long_reg_type.IsChar()); |
| 230 | EXPECT_FALSE(long_reg_type.IsShort()); |
| 231 | EXPECT_FALSE(long_reg_type.IsInteger()); |
| 232 | EXPECT_TRUE(long_reg_type.IsLong()); |
| 233 | EXPECT_FALSE(long_reg_type.IsFloat()); |
| 234 | EXPECT_FALSE(long_reg_type.IsDouble()); |
| 235 | EXPECT_FALSE(long_reg_type.IsReference()); |
| 236 | EXPECT_TRUE(long_reg_type.IsLowHalf()); |
| 237 | EXPECT_FALSE(long_reg_type.IsHighHalf()); |
| 238 | EXPECT_TRUE(long_reg_type.IsLongOrDoubleTypes()); |
| 239 | EXPECT_FALSE(long_reg_type.IsReferenceTypes()); |
| 240 | EXPECT_FALSE(long_reg_type.IsCategory1Types()); |
| 241 | EXPECT_TRUE(long_reg_type.IsCategory2Types()); |
| 242 | EXPECT_FALSE(long_reg_type.IsBooleanTypes()); |
| 243 | EXPECT_FALSE(long_reg_type.IsByteTypes()); |
| 244 | EXPECT_FALSE(long_reg_type.IsShortTypes()); |
| 245 | EXPECT_FALSE(long_reg_type.IsCharTypes()); |
| 246 | EXPECT_FALSE(long_reg_type.IsIntegralTypes()); |
| 247 | EXPECT_FALSE(long_reg_type.IsFloatTypes()); |
| 248 | EXPECT_TRUE(long_reg_type.IsLongTypes()); |
| 249 | EXPECT_FALSE(long_reg_type.IsDoubleTypes()); |
| 250 | EXPECT_FALSE(long_reg_type.IsArrayIndexTypes()); |
| 251 | |
| 252 | const RegType& float_reg_type = cache.Float(); |
| 253 | EXPECT_FALSE(float_reg_type.IsUnknown()); |
| 254 | EXPECT_FALSE(float_reg_type.IsConflict()); |
| 255 | EXPECT_FALSE(float_reg_type.IsZero()); |
| 256 | EXPECT_FALSE(float_reg_type.IsOne()); |
Ian Rogers | 84fa074 | 2011-10-25 18:13:30 -0700 | [diff] [blame] | 257 | EXPECT_FALSE(float_reg_type.IsLongConstant()); |
Ian Rogers | d81871c | 2011-10-03 13:57:23 -0700 | [diff] [blame] | 258 | EXPECT_FALSE(float_reg_type.IsBoolean()); |
| 259 | EXPECT_FALSE(float_reg_type.IsByte()); |
| 260 | EXPECT_FALSE(float_reg_type.IsChar()); |
| 261 | EXPECT_FALSE(float_reg_type.IsShort()); |
| 262 | EXPECT_FALSE(float_reg_type.IsInteger()); |
| 263 | EXPECT_FALSE(float_reg_type.IsLong()); |
| 264 | EXPECT_TRUE(float_reg_type.IsFloat()); |
| 265 | EXPECT_FALSE(float_reg_type.IsDouble()); |
| 266 | EXPECT_FALSE(float_reg_type.IsReference()); |
| 267 | EXPECT_FALSE(float_reg_type.IsLowHalf()); |
| 268 | EXPECT_FALSE(float_reg_type.IsHighHalf()); |
| 269 | EXPECT_FALSE(float_reg_type.IsLongOrDoubleTypes()); |
| 270 | EXPECT_FALSE(float_reg_type.IsReferenceTypes()); |
| 271 | EXPECT_TRUE(float_reg_type.IsCategory1Types()); |
| 272 | EXPECT_FALSE(float_reg_type.IsCategory2Types()); |
| 273 | EXPECT_FALSE(float_reg_type.IsBooleanTypes()); |
| 274 | EXPECT_FALSE(float_reg_type.IsByteTypes()); |
| 275 | EXPECT_FALSE(float_reg_type.IsShortTypes()); |
| 276 | EXPECT_FALSE(float_reg_type.IsCharTypes()); |
| 277 | EXPECT_FALSE(float_reg_type.IsIntegralTypes()); |
| 278 | EXPECT_TRUE(float_reg_type.IsFloatTypes()); |
| 279 | EXPECT_FALSE(float_reg_type.IsLongTypes()); |
| 280 | EXPECT_FALSE(float_reg_type.IsDoubleTypes()); |
| 281 | EXPECT_FALSE(float_reg_type.IsArrayIndexTypes()); |
| 282 | |
| 283 | const RegType& double_reg_type = cache.Double(); |
| 284 | EXPECT_FALSE(double_reg_type.IsUnknown()); |
| 285 | EXPECT_FALSE(double_reg_type.IsConflict()); |
| 286 | EXPECT_FALSE(double_reg_type.IsZero()); |
| 287 | EXPECT_FALSE(double_reg_type.IsOne()); |
Ian Rogers | 84fa074 | 2011-10-25 18:13:30 -0700 | [diff] [blame] | 288 | EXPECT_FALSE(double_reg_type.IsLongConstant()); |
Ian Rogers | d81871c | 2011-10-03 13:57:23 -0700 | [diff] [blame] | 289 | EXPECT_FALSE(double_reg_type.IsBoolean()); |
| 290 | EXPECT_FALSE(double_reg_type.IsByte()); |
| 291 | EXPECT_FALSE(double_reg_type.IsChar()); |
| 292 | EXPECT_FALSE(double_reg_type.IsShort()); |
| 293 | EXPECT_FALSE(double_reg_type.IsInteger()); |
| 294 | EXPECT_FALSE(double_reg_type.IsLong()); |
| 295 | EXPECT_FALSE(double_reg_type.IsFloat()); |
| 296 | EXPECT_TRUE(double_reg_type.IsDouble()); |
| 297 | EXPECT_FALSE(double_reg_type.IsReference()); |
| 298 | EXPECT_TRUE(double_reg_type.IsLowHalf()); |
| 299 | EXPECT_FALSE(double_reg_type.IsHighHalf()); |
| 300 | EXPECT_TRUE(double_reg_type.IsLongOrDoubleTypes()); |
| 301 | EXPECT_FALSE(double_reg_type.IsReferenceTypes()); |
| 302 | EXPECT_FALSE(double_reg_type.IsCategory1Types()); |
| 303 | EXPECT_TRUE(double_reg_type.IsCategory2Types()); |
| 304 | EXPECT_FALSE(double_reg_type.IsBooleanTypes()); |
| 305 | EXPECT_FALSE(double_reg_type.IsByteTypes()); |
| 306 | EXPECT_FALSE(double_reg_type.IsShortTypes()); |
| 307 | EXPECT_FALSE(double_reg_type.IsCharTypes()); |
| 308 | EXPECT_FALSE(double_reg_type.IsIntegralTypes()); |
| 309 | EXPECT_FALSE(double_reg_type.IsFloatTypes()); |
| 310 | EXPECT_FALSE(double_reg_type.IsLongTypes()); |
| 311 | EXPECT_TRUE(double_reg_type.IsDoubleTypes()); |
| 312 | EXPECT_FALSE(double_reg_type.IsArrayIndexTypes()); |
| 313 | } |
| 314 | |
| 315 | // TODO: test reference RegType |
| 316 | // TODO: test constant RegType |
| 317 | // TODO: test VerifyAgainst |
| 318 | // TODO: test Merge |
| 319 | // TODO: test Equals |
| 320 | // TODO: test ClassJoin |
| 321 | |
| 322 | } // namespace verifier |
jeffhao | ba5ebb9 | 2011-08-25 17:24:37 -0700 | [diff] [blame] | 323 | } // namespace art |