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

Unified Diff: test/cctest/test-cpu.cc

Issue 23401002: Fix the CPU feature detection. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Improve cpuinfo parsing. Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/test-cpu-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-cpu.cc
diff --git a/test/mjsunit/regress/regress-2593.js b/test/cctest/test-cpu.cc
similarity index 75%
copy from test/mjsunit/regress/regress-2593.js
copy to test/cctest/test-cpu.cc
index b51b41c27e65d8f6344f3cc22f9fec2c5a99b92d..1c61ab1c46fd151068caa40bdae559f7332efcb1 100644
--- a/test/mjsunit/regress/regress-2593.js
+++ b/test/cctest/test-cpu.cc
@@ -25,37 +25,26 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --expose_gc
+#include "v8.h"
-p1 = { };
-p2 = { };
-p3 = { x : 1 };
-p2.__proto__ = p3
-p1.__proto__ = p2
+#include "cctest.h"
+#include "cpu.h"
-// Normalize p1.
-p1.z = 1
-delete p1.z
+using namespace v8::internal;
-// Make sure all objects are in old space.
-for (var i = 0; i < 10; i++) gc();
-function f2() {
- p2.x;
-}
-
-function f1() {
- return p1.x;
-}
-
-// Create load stub in p2.
-for (var i = 0; i < 10; i++) f2();
+TEST(FeatureImplications) {
+ // Test for features implied by other features.
+ CPU cpu;
-// Create load stub in p2 for p1.
-for (var i = 0; i < 10; i++) f1();
+ // ia32 and x64 features
+ CHECK(!cpu.has_sse() || cpu.has_mmx());
+ CHECK(!cpu.has_sse2() || cpu.has_sse());
+ CHECK(!cpu.has_sse3() || cpu.has_sse2());
+ CHECK(!cpu.has_ssse3() || cpu.has_sse3());
+ CHECK(!cpu.has_sse41() || cpu.has_sse3());
+ CHECK(!cpu.has_sse42() || cpu.has_sse41());
-assertEquals(1, f1());
-
-p2.x = 2;
-
-assertEquals(2, f1());
+ // arm features
+ CHECK(!cpu.has_vfp3_d32() || cpu.has_vfp3());
+}
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/test-cpu-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698