1 #include <gtest/gtest.h> 2 3 #include <cpuinfo.h> 4 #include <cpuinfo-mock.h> 5 6 7 TEST(PROCESSORS, count) { 8 ASSERT_EQ(8, cpuinfo_get_processors_count()); 9 } 10 11 TEST(PROCESSORS, non_null) { 12 ASSERT_TRUE(cpuinfo_get_processors()); 13 } 14 15 TEST(PROCESSORS, smt_id) { 16 for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { 17 ASSERT_EQ(0, cpuinfo_get_processor(i)->smt_id); 18 } 19 } 20 21 TEST(PROCESSORS, core) { 22 for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { 23 ASSERT_EQ(cpuinfo_get_core(i), cpuinfo_get_processor(i)->core); 24 } 25 } 26 27 TEST(PROCESSORS, cluster) { 28 for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { 29 switch (i) { 30 case 0: 31 case 1: 32 case 2: 33 case 3: 34 ASSERT_EQ(cpuinfo_get_cluster(0), cpuinfo_get_processor(i)->cluster); 35 break; 36 case 4: 37 case 5: 38 case 6: 39 case 7: 40 ASSERT_EQ(cpuinfo_get_cluster(1), cpuinfo_get_processor(i)->cluster); 41 break; 42 } 43 } 44 } 45 46 TEST(PROCESSORS, package) { 47 for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { 48 ASSERT_EQ(cpuinfo_get_package(0), cpuinfo_get_processor(i)->package); 49 } 50 } 51 52 TEST(PROCESSORS, linux_id) { 53 for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { 54 ASSERT_EQ(i, cpuinfo_get_processor(i)->linux_id); 55 } 56 } 57 58 TEST(PROCESSORS, l1i) { 59 for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { 60 ASSERT_EQ(cpuinfo_get_l1i_cache(i), cpuinfo_get_processor(i)->cache.l1i); 61 } 62 } 63 64 TEST(PROCESSORS, l1d) { 65 for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { 66 ASSERT_EQ(cpuinfo_get_l1d_cache(i), cpuinfo_get_processor(i)->cache.l1d); 67 } 68 } 69 70 TEST(PROCESSORS, l2) { 71 for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { 72 switch (i) { 73 case 0: 74 case 1: 75 case 2: 76 case 3: 77 ASSERT_EQ(cpuinfo_get_l2_cache(0), cpuinfo_get_processor(i)->cache.l2); 78 break; 79 case 4: 80 case 5: 81 case 6: 82 case 7: 83 ASSERT_EQ(cpuinfo_get_l2_cache(1), cpuinfo_get_processor(i)->cache.l2); 84 break; 85 } 86 } 87 } 88 89 TEST(PROCESSORS, l3) { 90 for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { 91 ASSERT_FALSE(cpuinfo_get_processor(i)->cache.l3); 92 } 93 } 94 95 TEST(PROCESSORS, l4) { 96 for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { 97 ASSERT_FALSE(cpuinfo_get_processor(i)->cache.l4); 98 } 99 } 100 101 TEST(CORES, count) { 102 ASSERT_EQ(8, cpuinfo_get_cores_count()); 103 } 104 105 TEST(CORES, non_null) { 106 ASSERT_TRUE(cpuinfo_get_cores()); 107 } 108 109 TEST(CORES, processor_start) { 110 for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { 111 ASSERT_EQ(i, cpuinfo_get_core(i)->processor_start); 112 } 113 } 114 115 TEST(CORES, processor_count) { 116 for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { 117 ASSERT_EQ(1, cpuinfo_get_core(i)->processor_count); 118 } 119 } 120 121 TEST(CORES, core_id) { 122 for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { 123 ASSERT_EQ(i, cpuinfo_get_core(i)->core_id); 124 } 125 } 126 127 TEST(CORES, cluster) { 128 for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { 129 switch (i) { 130 case 0: 131 case 1: 132 case 2: 133 case 3: 134 ASSERT_EQ(cpuinfo_get_cluster(0), cpuinfo_get_core(i)->cluster); 135 break; 136 case 4: 137 case 5: 138 case 6: 139 case 7: 140 ASSERT_EQ(cpuinfo_get_cluster(1), cpuinfo_get_core(i)->cluster); 141 break; 142 } 143 } 144 } 145 146 TEST(CORES, package) { 147 for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { 148 ASSERT_EQ(cpuinfo_get_package(0), cpuinfo_get_core(i)->package); 149 } 150 } 151 152 TEST(CORES, vendor) { 153 for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { 154 ASSERT_EQ(cpuinfo_vendor_arm, cpuinfo_get_core(i)->vendor); 155 } 156 } 157 158 TEST(CORES, uarch) { 159 for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { 160 ASSERT_EQ(cpuinfo_uarch_cortex_a53, cpuinfo_get_core(i)->uarch); 161 } 162 } 163 164 TEST(CORES, midr) { 165 for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { 166 ASSERT_EQ(UINT32_C(0x410FD033), cpuinfo_get_core(i)->midr); 167 } 168 } 169 170 TEST(CORES, DISABLED_frequency) { 171 for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { 172 ASSERT_EQ(UINT64_C(1200000000), cpuinfo_get_core(i)->frequency); 173 } 174 } 175 176 TEST(CLUSTERS, count) { 177 ASSERT_EQ(2, cpuinfo_get_clusters_count()); 178 } 179 180 TEST(CLUSTERS, non_null) { 181 ASSERT_TRUE(cpuinfo_get_clusters()); 182 } 183 184 TEST(CLUSTERS, processor_start) { 185 for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) { 186 switch (i) { 187 case 0: 188 ASSERT_EQ(0, cpuinfo_get_cluster(i)->processor_start); 189 break; 190 case 1: 191 ASSERT_EQ(4, cpuinfo_get_cluster(i)->processor_start); 192 break; 193 } 194 } 195 } 196 197 TEST(CLUSTERS, processor_count) { 198 for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) { 199 ASSERT_EQ(4, cpuinfo_get_cluster(i)->processor_count); 200 } 201 } 202 203 TEST(CLUSTERS, core_start) { 204 for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) { 205 switch (i) { 206 case 0: 207 ASSERT_EQ(0, cpuinfo_get_cluster(i)->core_start); 208 break; 209 case 1: 210 ASSERT_EQ(4, cpuinfo_get_cluster(i)->core_start); 211 break; 212 } 213 } 214 } 215 216 TEST(CLUSTERS, core_count) { 217 for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) { 218 ASSERT_EQ(4, cpuinfo_get_cluster(i)->core_count); 219 } 220 } 221 222 TEST(CLUSTERS, cluster_id) { 223 for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) { 224 ASSERT_EQ(i, cpuinfo_get_cluster(i)->cluster_id); 225 } 226 } 227 228 TEST(CLUSTERS, package) { 229 for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) { 230 ASSERT_EQ(cpuinfo_get_package(0), cpuinfo_get_cluster(i)->package); 231 } 232 } 233 234 TEST(CLUSTERS, vendor) { 235 for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) { 236 ASSERT_EQ(cpuinfo_vendor_arm, cpuinfo_get_cluster(i)->vendor); 237 } 238 } 239 240 TEST(CLUSTERS, uarch) { 241 for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) { 242 ASSERT_EQ(cpuinfo_uarch_cortex_a53, cpuinfo_get_cluster(i)->uarch); 243 } 244 } 245 246 TEST(CLUSTERS, midr) { 247 for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) { 248 ASSERT_EQ(UINT32_C(0x410FD033), cpuinfo_get_cluster(i)->midr); 249 } 250 } 251 252 TEST(CLUSTERS, DISABLED_frequency) { 253 for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) { 254 ASSERT_EQ(UINT64_C(1200000000), cpuinfo_get_cluster(i)->frequency); 255 } 256 } 257 258 TEST(PACKAGES, count) { 259 ASSERT_EQ(1, cpuinfo_get_packages_count()); 260 } 261 262 TEST(PACKAGES, name) { 263 for (uint32_t i = 0; i < cpuinfo_get_packages_count(); i++) { 264 ASSERT_EQ("HiSilicon Kirin 620", 265 std::string(cpuinfo_get_package(i)->name, 266 strnlen(cpuinfo_get_package(i)->name, CPUINFO_PACKAGE_NAME_MAX))); 267 } 268 } 269 270 TEST(PACKAGES, processor_start) { 271 for (uint32_t i = 0; i < cpuinfo_get_packages_count(); i++) { 272 ASSERT_EQ(0, cpuinfo_get_package(i)->processor_start); 273 } 274 } 275 276 TEST(PACKAGES, processor_count) { 277 for (uint32_t i = 0; i < cpuinfo_get_packages_count(); i++) { 278 ASSERT_EQ(8, cpuinfo_get_package(i)->processor_count); 279 } 280 } 281 282 TEST(PACKAGES, core_start) { 283 for (uint32_t i = 0; i < cpuinfo_get_packages_count(); i++) { 284 ASSERT_EQ(0, cpuinfo_get_package(i)->core_start); 285 } 286 } 287 288 TEST(PACKAGES, core_count) { 289 for (uint32_t i = 0; i < cpuinfo_get_packages_count(); i++) { 290 ASSERT_EQ(8, cpuinfo_get_package(i)->core_count); 291 } 292 } 293 294 TEST(PACKAGES, cluster_start) { 295 for (uint32_t i = 0; i < cpuinfo_get_packages_count(); i++) { 296 ASSERT_EQ(0, cpuinfo_get_package(i)->cluster_start); 297 } 298 } 299 300 TEST(PACKAGES, cluster_count) { 301 for (uint32_t i = 0; i < cpuinfo_get_packages_count(); i++) { 302 ASSERT_EQ(2, cpuinfo_get_package(i)->cluster_count); 303 } 304 } 305 306 TEST(ISA, thumb) { 307 #if CPUINFO_ARCH_ARM 308 ASSERT_TRUE(cpuinfo_has_arm_thumb()); 309 #elif CPUINFO_ARCH_ARM64 310 ASSERT_FALSE(cpuinfo_has_arm_thumb()); 311 #endif 312 } 313 314 TEST(ISA, thumb2) { 315 #if CPUINFO_ARCH_ARM 316 ASSERT_TRUE(cpuinfo_has_arm_thumb2()); 317 #elif CPUINFO_ARCH_ARM64 318 ASSERT_FALSE(cpuinfo_has_arm_thumb2()); 319 #endif 320 } 321 322 TEST(ISA, armv5e) { 323 #if CPUINFO_ARCH_ARM 324 ASSERT_TRUE(cpuinfo_has_arm_v5e()); 325 #elif CPUINFO_ARCH_ARM64 326 ASSERT_FALSE(cpuinfo_has_arm_v5e()); 327 #endif 328 } 329 330 TEST(ISA, armv6) { 331 #if CPUINFO_ARCH_ARM 332 ASSERT_TRUE(cpuinfo_has_arm_v6()); 333 #elif CPUINFO_ARCH_ARM64 334 ASSERT_FALSE(cpuinfo_has_arm_v6()); 335 #endif 336 } 337 338 TEST(ISA, armv6k) { 339 #if CPUINFO_ARCH_ARM 340 ASSERT_TRUE(cpuinfo_has_arm_v6k()); 341 #elif CPUINFO_ARCH_ARM64 342 ASSERT_FALSE(cpuinfo_has_arm_v6k()); 343 #endif 344 } 345 346 TEST(ISA, armv7) { 347 #if CPUINFO_ARCH_ARM 348 ASSERT_TRUE(cpuinfo_has_arm_v7()); 349 #elif CPUINFO_ARCH_ARM64 350 ASSERT_FALSE(cpuinfo_has_arm_v7()); 351 #endif 352 } 353 354 TEST(ISA, armv7mp) { 355 #if CPUINFO_ARCH_ARM 356 ASSERT_TRUE(cpuinfo_has_arm_v7mp()); 357 #elif CPUINFO_ARCH_ARM64 358 ASSERT_FALSE(cpuinfo_has_arm_v7mp()); 359 #endif 360 } 361 362 TEST(ISA, idiv) { 363 ASSERT_TRUE(cpuinfo_has_arm_idiv()); 364 } 365 366 TEST(ISA, vfpv2) { 367 ASSERT_FALSE(cpuinfo_has_arm_vfpv2()); 368 } 369 370 TEST(ISA, vfpv3) { 371 ASSERT_TRUE(cpuinfo_has_arm_vfpv3()); 372 } 373 374 TEST(ISA, vfpv3_d32) { 375 ASSERT_TRUE(cpuinfo_has_arm_vfpv3_d32()); 376 } 377 378 TEST(ISA, vfpv3_fp16) { 379 ASSERT_TRUE(cpuinfo_has_arm_vfpv3_fp16()); 380 } 381 382 TEST(ISA, vfpv3_fp16_d32) { 383 ASSERT_TRUE(cpuinfo_has_arm_vfpv3_fp16_d32()); 384 } 385 386 TEST(ISA, vfpv4) { 387 ASSERT_TRUE(cpuinfo_has_arm_vfpv4()); 388 } 389 390 TEST(ISA, vfpv4_d32) { 391 ASSERT_TRUE(cpuinfo_has_arm_vfpv4_d32()); 392 } 393 394 TEST(ISA, wmmx) { 395 ASSERT_FALSE(cpuinfo_has_arm_wmmx()); 396 } 397 398 TEST(ISA, wmmx2) { 399 ASSERT_FALSE(cpuinfo_has_arm_wmmx2()); 400 } 401 402 TEST(ISA, neon) { 403 ASSERT_TRUE(cpuinfo_has_arm_neon()); 404 } 405 406 TEST(ISA, neon_fp16) { 407 ASSERT_TRUE(cpuinfo_has_arm_neon_fp16()); 408 } 409 410 TEST(ISA, neon_fma) { 411 ASSERT_TRUE(cpuinfo_has_arm_neon_fma()); 412 } 413 414 TEST(ISA, atomics) { 415 ASSERT_FALSE(cpuinfo_has_arm_atomics()); 416 } 417 418 TEST(ISA, neon_rdm) { 419 ASSERT_FALSE(cpuinfo_has_arm_neon_rdm()); 420 } 421 422 TEST(ISA, fp16_arith) { 423 ASSERT_FALSE(cpuinfo_has_arm_fp16_arith()); 424 } 425 426 TEST(ISA, neon_fp16_arith) { 427 ASSERT_FALSE(cpuinfo_has_arm_neon_fp16_arith()); 428 } 429 430 TEST(ISA, neon_dot) { 431 ASSERT_FALSE(cpuinfo_has_arm_neon_dot()); 432 } 433 434 TEST(ISA, jscvt) { 435 ASSERT_FALSE(cpuinfo_has_arm_jscvt()); 436 } 437 438 TEST(ISA, fcma) { 439 ASSERT_FALSE(cpuinfo_has_arm_fcma()); 440 } 441 442 TEST(ISA, aes) { 443 ASSERT_TRUE(cpuinfo_has_arm_aes()); 444 } 445 446 TEST(ISA, sha1) { 447 ASSERT_TRUE(cpuinfo_has_arm_sha1()); 448 } 449 450 TEST(ISA, sha2) { 451 ASSERT_TRUE(cpuinfo_has_arm_sha2()); 452 } 453 454 TEST(ISA, pmull) { 455 ASSERT_TRUE(cpuinfo_has_arm_pmull()); 456 } 457 458 TEST(ISA, crc32) { 459 ASSERT_TRUE(cpuinfo_has_arm_crc32()); 460 } 461 462 TEST(L1I, count) { 463 ASSERT_EQ(8, cpuinfo_get_l1i_caches_count()); 464 } 465 466 TEST(L1I, non_null) { 467 ASSERT_TRUE(cpuinfo_get_l1i_caches()); 468 } 469 470 TEST(L1I, size) { 471 for (uint32_t i = 0; i < cpuinfo_get_l1i_caches_count(); i++) { 472 ASSERT_EQ(32 * 1024, cpuinfo_get_l1i_cache(i)->size); 473 } 474 } 475 476 TEST(L1I, associativity) { 477 for (uint32_t i = 0; i < cpuinfo_get_l1i_caches_count(); i++) { 478 ASSERT_EQ(2, cpuinfo_get_l1i_cache(i)->associativity); 479 } 480 } 481 482 TEST(L1I, sets) { 483 for (uint32_t i = 0; i < cpuinfo_get_l1i_caches_count(); i++) { 484 ASSERT_EQ(cpuinfo_get_l1i_cache(i)->size, 485 cpuinfo_get_l1i_cache(i)->sets * cpuinfo_get_l1i_cache(i)->line_size * cpuinfo_get_l1i_cache(i)->partitions * cpuinfo_get_l1i_cache(i)->associativity); 486 } 487 } 488 489 TEST(L1I, partitions) { 490 for (uint32_t i = 0; i < cpuinfo_get_l1i_caches_count(); i++) { 491 ASSERT_EQ(1, cpuinfo_get_l1i_cache(i)->partitions); 492 } 493 } 494 495 TEST(L1I, line_size) { 496 for (uint32_t i = 0; i < cpuinfo_get_l1i_caches_count(); i++) { 497 ASSERT_EQ(64, cpuinfo_get_l1i_cache(i)->line_size); 498 } 499 } 500 501 TEST(L1I, flags) { 502 for (uint32_t i = 0; i < cpuinfo_get_l1i_caches_count(); i++) { 503 ASSERT_EQ(0, cpuinfo_get_l1i_cache(i)->flags); 504 } 505 } 506 507 TEST(L1I, processors) { 508 for (uint32_t i = 0; i < cpuinfo_get_l1i_caches_count(); i++) { 509 ASSERT_EQ(i, cpuinfo_get_l1i_cache(i)->processor_start); 510 ASSERT_EQ(1, cpuinfo_get_l1i_cache(i)->processor_count); 511 } 512 } 513 514 TEST(L1D, count) { 515 ASSERT_EQ(8, cpuinfo_get_l1d_caches_count()); 516 } 517 518 TEST(L1D, non_null) { 519 ASSERT_TRUE(cpuinfo_get_l1d_caches()); 520 } 521 522 TEST(L1D, size) { 523 for (uint32_t i = 0; i < cpuinfo_get_l1d_caches_count(); i++) { 524 ASSERT_EQ(32 * 1024, cpuinfo_get_l1d_cache(i)->size); 525 } 526 } 527 528 TEST(L1D, associativity) { 529 for (uint32_t i = 0; i < cpuinfo_get_l1d_caches_count(); i++) { 530 ASSERT_EQ(4, cpuinfo_get_l1d_cache(i)->associativity); 531 } 532 } 533 534 TEST(L1D, sets) { 535 for (uint32_t i = 0; i < cpuinfo_get_l1d_caches_count(); i++) { 536 ASSERT_EQ(cpuinfo_get_l1d_cache(i)->size, 537 cpuinfo_get_l1d_cache(i)->sets * cpuinfo_get_l1d_cache(i)->line_size * cpuinfo_get_l1d_cache(i)->partitions * cpuinfo_get_l1d_cache(i)->associativity); 538 } 539 } 540 541 TEST(L1D, partitions) { 542 for (uint32_t i = 0; i < cpuinfo_get_l1d_caches_count(); i++) { 543 ASSERT_EQ(1, cpuinfo_get_l1d_cache(i)->partitions); 544 } 545 } 546 547 TEST(L1D, line_size) { 548 for (uint32_t i = 0; i < cpuinfo_get_l1d_caches_count(); i++) { 549 ASSERT_EQ(64, cpuinfo_get_l1d_cache(i)->line_size); 550 } 551 } 552 553 TEST(L1D, flags) { 554 for (uint32_t i = 0; i < cpuinfo_get_l1d_caches_count(); i++) { 555 ASSERT_EQ(0, cpuinfo_get_l1d_cache(i)->flags); 556 } 557 } 558 559 TEST(L1D, processors) { 560 for (uint32_t i = 0; i < cpuinfo_get_l1d_caches_count(); i++) { 561 ASSERT_EQ(i, cpuinfo_get_l1d_cache(i)->processor_start); 562 ASSERT_EQ(1, cpuinfo_get_l1d_cache(i)->processor_count); 563 } 564 } 565 566 TEST(L2, count) { 567 ASSERT_EQ(2, cpuinfo_get_l2_caches_count()); 568 } 569 570 TEST(L2, non_null) { 571 ASSERT_TRUE(cpuinfo_get_l2_caches()); 572 } 573 574 TEST(L2, size) { 575 for (uint32_t i = 0; i < cpuinfo_get_l2_caches_count(); i++) { 576 ASSERT_EQ(512 * 1024, cpuinfo_get_l2_cache(i)->size); 577 } 578 } 579 580 TEST(L2, associativity) { 581 for (uint32_t i = 0; i < cpuinfo_get_l2_caches_count(); i++) { 582 ASSERT_EQ(16, cpuinfo_get_l2_cache(i)->associativity); 583 } 584 } 585 586 TEST(L2, sets) { 587 for (uint32_t i = 0; i < cpuinfo_get_l2_caches_count(); i++) { 588 ASSERT_EQ(cpuinfo_get_l2_cache(i)->size, 589 cpuinfo_get_l2_cache(i)->sets * cpuinfo_get_l2_cache(i)->line_size * cpuinfo_get_l2_cache(i)->partitions * cpuinfo_get_l2_cache(i)->associativity); 590 } 591 } 592 593 TEST(L2, partitions) { 594 for (uint32_t i = 0; i < cpuinfo_get_l2_caches_count(); i++) { 595 ASSERT_EQ(1, cpuinfo_get_l2_cache(i)->partitions); 596 } 597 } 598 599 TEST(L2, line_size) { 600 for (uint32_t i = 0; i < cpuinfo_get_l2_caches_count(); i++) { 601 ASSERT_EQ(64, cpuinfo_get_l2_cache(i)->line_size); 602 } 603 } 604 605 TEST(L2, flags) { 606 for (uint32_t i = 0; i < cpuinfo_get_l2_caches_count(); i++) { 607 ASSERT_EQ(0, cpuinfo_get_l2_cache(i)->flags); 608 } 609 } 610 611 TEST(L2, processors) { 612 for (uint32_t i = 0; i < cpuinfo_get_l2_caches_count(); i++) { 613 switch (i) { 614 case 0: 615 ASSERT_EQ(0, cpuinfo_get_l2_cache(i)->processor_start); 616 ASSERT_EQ(4, cpuinfo_get_l2_cache(i)->processor_count); 617 break; 618 case 1: 619 ASSERT_EQ(4, cpuinfo_get_l2_cache(i)->processor_start); 620 ASSERT_EQ(4, cpuinfo_get_l2_cache(i)->processor_count); 621 break; 622 } 623 } 624 } 625 626 TEST(L3, none) { 627 ASSERT_EQ(0, cpuinfo_get_l3_caches_count()); 628 ASSERT_FALSE(cpuinfo_get_l3_caches()); 629 } 630 631 TEST(L4, none) { 632 ASSERT_EQ(0, cpuinfo_get_l4_caches_count()); 633 ASSERT_FALSE(cpuinfo_get_l4_caches()); 634 } 635 636 #include <huawei-p8-lite.h> 637 638 int main(int argc, char* argv[]) { 639 #if CPUINFO_ARCH_ARM 640 cpuinfo_set_hwcap(UINT32_C(0x0027B0D6)); 641 cpuinfo_set_hwcap2(UINT32_C(0x0000001F)); 642 #elif CPUINFO_ARCH_ARM64 643 cpuinfo_set_hwcap(UINT32_C(0x000000FF)); 644 #endif 645 cpuinfo_mock_filesystem(filesystem); 646 #ifdef __ANDROID__ 647 cpuinfo_mock_android_properties(properties); 648 #endif 649 cpuinfo_initialize(); 650 ::testing::InitGoogleTest(&argc, argv); 651 return RUN_ALL_TESTS(); 652 } 653