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

Side by Side Diff: test/cctest/test-sh4.cc

Issue 11275184: First draft of the sh4 port Base URL: http://github.com/v8/v8.git@master
Patch Set: Use GYP and fixe some typos Created 8 years, 1 month 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
« no previous file with comments | « test/cctest/test-regressions-sh4.cc ('k') | tools/gyp/v8.gyp » ('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 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 #include <stdlib.h>
29
30 #include "v8.h"
31
32 #include "platform.h"
33 #include "cctest.h"
34
35 using namespace v8::internal;
36
37
38 TEST(sh4) {
39 // Disable compilation of natives.
40 i::FLAG_disable_native_files = true;
41
42 v8::HandleScope scope;
43 LocalContext env; // from cctest.h
44
45 const char* c_source = "0x1234;";
46 v8::Handle<v8::String> source = v8::String::New(c_source);
47 v8::Handle<v8::Script> script = v8::Script::Compile(source);
48 CHECK_EQ(0x1234, script->Run()->Int32Value());
49 }
50
51 TEST(sh4_1) {
52 // Disable compilation of natives.
53 i::FLAG_disable_native_files = true;
54
55 v8::HandleScope scope;
56 LocalContext env; // from cctest.h
57
58 const char* c_source = "0x1234 + 0x10;";
59 v8::Handle<v8::String> source = v8::String::New(c_source);
60 v8::Handle<v8::Script> script = v8::Script::Compile(source);
61 CHECK_EQ(0x1244, script->Run()->Int32Value());
62 }
63
64 TEST(sh4_2) {
65 // Disable compilation of natives.
66 i::FLAG_disable_native_files = true;
67
68 v8::HandleScope scope;
69 LocalContext env; // from cctest.h
70
71 const char* c_source = "function foo() { return 0x1234; }; foo();";
72 v8::Handle<v8::String> source = v8::String::New(c_source);
73 v8::Handle<v8::Script> script = v8::Script::Compile(source);
74 CHECK_EQ(0x1234, script->Run()->Int32Value());
75 }
76
77 TEST(sh4_3) {
78 // Disable compilation of natives.
79 i::FLAG_disable_native_files = false;
80
81 v8::HandleScope scope;
82 LocalContext env; // from cctest.h
83
84 const char* c_source = "\"foo\" + \"bar\" != \"foobar\";";
85 v8::Handle<v8::String> source = v8::String::New(c_source);
86 v8::Handle<v8::Script> script = v8::Script::Compile(source);
87 CHECK_EQ(0, script->Run()->Int32Value());
88 }
89
90 TEST(sh4_4) {
91 // Disable compilation of natives.
92 i::FLAG_disable_native_files = true;
93
94 v8::HandleScope scope;
95 LocalContext env; // from cctest.h
96
97 const char* c_source = "0x1235 - 1;";
98 v8::Handle<v8::String> source = v8::String::New(c_source);
99 v8::Handle<v8::Script> script = v8::Script::Compile(source);
100 CHECK_EQ(0X1234, script->Run()->Int32Value());
101 }
102
103 TEST(sh4_5) {
104 // Disable compilation of natives.
105 i::FLAG_disable_native_files = true;
106
107 v8::HandleScope scope;
108 LocalContext env; // from cctest.h
109
110 const char* c_source = "0x123 * 16;";
111 v8::Handle<v8::String> source = v8::String::New(c_source);
112 v8::Handle<v8::Script> script = v8::Script::Compile(source);
113 CHECK_EQ(0X1230, script->Run()->Int32Value());
114 }
115
OLDNEW
« no previous file with comments | « test/cctest/test-regressions-sh4.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698