Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/base/cpu-unittest.cc

Issue 615393002: Move unit tests to test/unittests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/base/bits-unittest.cc ('k') | src/base/division-by-constant-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "src/base/cpu.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 namespace v8 {
9 namespace base {
10
11 TEST(CPUTest, FeatureImplications) {
12 CPU cpu;
13
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());
21
22 // arm features
23 EXPECT_TRUE(!cpu.has_vfp3_d32() || cpu.has_vfp3());
24 }
25
26
27 TEST(CPUTest, RequiredFeatures) {
28 CPU cpu;
29
30 #if V8_HOST_ARCH_ARM
31 EXPECT_TRUE(cpu.has_fpu());
32 #endif
33
34 #if V8_HOST_ARCH_IA32
35 EXPECT_TRUE(cpu.has_fpu());
36 EXPECT_TRUE(cpu.has_sahf());
37 #endif
38
39 #if V8_HOST_ARCH_X64
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());
45 #endif
46 }
47
48 } // namespace base
49 } // namespace v8
OLDNEW
« no previous file with comments | « src/base/bits-unittest.cc ('k') | src/base/division-by-constant-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698