1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "src/base/cpu.h"
6 #include "testing/gtest/include/gtest/gtest.h"
11 TEST(CPUTest, FeatureImplications) {
14 // ia32 and x64 features
15 EXPECT_TRUE(!cpu.has_sse() || cpu.has_mmx());
16 EXPECT_TRUE(!cpu.has_sse2() || cpu.has_sse());
17 EXPECT_TRUE(!cpu.has_sse3() || cpu.has_sse2());
18 EXPECT_TRUE(!cpu.has_ssse3() || cpu.has_sse3());
19 EXPECT_TRUE(!cpu.has_sse41() || cpu.has_sse3());
20 EXPECT_TRUE(!cpu.has_sse42() || cpu.has_sse41());
23 EXPECT_TRUE(!cpu.has_vfp3_d32() || cpu.has_vfp3());
27 TEST(CPUTest, RequiredFeatures) {
31 EXPECT_TRUE(cpu.has_fpu());
35 EXPECT_TRUE(cpu.has_fpu());
36 EXPECT_TRUE(cpu.has_sahf());
40 EXPECT_TRUE(cpu.has_fpu());
41 EXPECT_TRUE(cpu.has_cmov());
42 EXPECT_TRUE(cpu.has_mmx());
43 EXPECT_TRUE(cpu.has_sse());
44 EXPECT_TRUE(cpu.has_sse2());