• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


コミットメタ情報

リビジョンbab80642035c2fe8565ccbadf18883b7d1df6437 (tree)
日時2009-07-10 05:54:54
作者Jack Palevich <jackpal@goog...>
コミッターJack Palevich

ログメッセージ

Add x86 floating point test.

変更サマリ

差分

--- a/libacc/acc.cpp
+++ b/libacc/acc.cpp
@@ -1335,7 +1335,6 @@ class Compiler : public ErrorSink {
13351335 }
13361336 popType();
13371337 setR0Type(pResultType);
1338- printf("genop: result type %d\n", pResultType->tag);
13391338 }
13401339 }
13411340
--- a/libacc/tests/test.py
+++ b/libacc/tests/test.py
@@ -59,8 +59,8 @@ def compileArm(args):
5959 def compare(a, b):
6060 if a != b:
6161 firstDiff = firstDifference(a, b)
62- print "Strings differ at character %d '%s' != '%s'" % (
63- firstDiff, safeAccess(a, firstDiff), safeAccess(b, firstDiff))
62+ print "Strings differ at character %d. Common: %s. Difference '%s' != '%s'" % (
63+ firstDiff, a[0:firstDiff], safeAccess(a, firstDiff), safeAccess(b, firstDiff))
6464
6565 def safeAccess(s, i):
6666 if 0 <= i < len(s):
@@ -97,7 +97,7 @@ class TestACC(unittest.TestCase):
9797 self.compileCheck(["-R", "data/returnval-ansi.c"],
9898 "Executing compiled code:\nresult: 42\n")
9999
100- def testStingLiteralConcatenation(self):
100+ def testStringLiteralConcatenation(self):
101101 self.compileCheck(["-R", "data/testStringConcat.c"],
102102 "Executing compiled code:\nresult: 13\n", "Hello, world\n")
103103
@@ -115,6 +115,64 @@ class TestACC(unittest.TestCase):
115115 "0 = 0\n010 = 8\n0x10 = 16\n'\\a' = 7\n'\\b' = 8\n'\\f' = 12\n'\\n' = 10\n'\\r' = 13\n'\\t' = 9\n'\\v' = 11\n'\\\\' = 92\n'\\'' = 39\n" +
116116 "'\\\"' = 34\n'\\?' = 63\n'\\0' = 0\n'\\1' = 1\n'\\12' = 10\n'\\123' = 83\n'\\x0' = 0\n'\\x1' = 1\n'\\x12' = 18\n'\\x123' = 291\n'\\x1f' = 31\n'\\x1F' = 31\n")
117117
118+ def testRunFloat(self):
119+ self.compileCheck(["-R", "data/float.c"],
120+ "Executing compiled code:\nresult: 0\n",
121+ "int: 1 float: 2.2 double: 3.3\n ftoi(1.4f)=1\n dtoi(2.4f)=2\n itof(3)=3\n itod(4)=4\nglobals: 1 2 3 4\nargs: 1 2 3 4\nlocals: 1 2 3 4\ncast rval: 2 4\ncast lval: 1.1 2 3.3 4\n")
122+
123+ def testRunFlops(self):
124+ self.compileCheck(["-R", "data/flops.c"],
125+ "Executing compiled code:\nresult: 0\n",
126+ "-1.1 = -1.1\n" +
127+ "!1.2 = 0\n" +
128+ "!0 = 1\n" +
129+ "double op double:\n" +
130+ "1 + 2 = 3\n" +
131+ "1 - 2 = -1\n" +
132+ "1 * 2 = 2\n" +
133+ "1 / 2 = 0.5\n" +
134+ "float op float:\n" +
135+ "1 + 2 = 3\n" +
136+ "1 - 2 = -1\n" +
137+ "1 * 2 = 2\n" +
138+ "1 / 2 = 0.5\n" +
139+ "double op float:\n" +
140+ "1 + 2 = 3\n" +
141+ "1 - 2 = -1\n" +
142+ "1 * 2 = 2\n" +
143+ "1 / 2 = 0.5\n" +
144+ "double op int:\n" +
145+ "1 + 2 = 3\n" +
146+ "1 - 2 = -1\n" +
147+ "1 * 2 = 2\n" +
148+ "1 / 2 = 0.5\n" +
149+ "int op double:\n" +
150+ "1 + 2 = 3\n" +
151+ "1 - 2 = -1\n" +
152+ "1 * 2 = 2\n" +
153+ "1 / 2 = 0.5\n" +
154+ "double op double:\n" +
155+ "1 op 2: < 1 <= 1 == 0 >= 0 > 0 != 1\n" +
156+ "1 op 1: < 0 <= 1 == 1 >= 1 > 0 != 0\n" +
157+ "2 op 1: < 0 <= 0 == 0 >= 1 > 1 != 1\n" +
158+ "double op float:\n" +
159+ "1 op 2: < 1 <= 1 == 0 >= 0 > 0 != 1\n" +
160+ "1 op 1: < 0 <= 1 == 1 >= 1 > 0 != 0\n" +
161+ "2 op 1: < 0 <= 0 == 0 >= 1 > 1 != 1\n" +
162+ "float op float:\n" +
163+ "1 op 2: < 1 <= 1 == 0 >= 0 > 0 != 1\n" +
164+ "1 op 1: < 0 <= 1 == 1 >= 1 > 0 != 0\n" +
165+ "2 op 1: < 0 <= 0 == 0 >= 1 > 1 != 1\n" +
166+ "int op double:\n" +
167+ "1 op 2: < 1 <= 1 == 0 >= 0 > 0 != 1\n" +
168+ "1 op 1: < 0 <= 1 == 1 >= 1 > 0 != 0\n" +
169+ "2 op 1: < 0 <= 0 == 0 >= 1 > 1 != 1\n" +
170+ "double op int:\n" +
171+ "1 op 2: < 1 <= 1 == 0 >= 0 > 0 != 1\n" +
172+ "1 op 1: < 0 <= 1 == 1 >= 1 > 0 != 0\n" +
173+ "2 op 1: < 0 <= 0 == 0 >= 1 > 1 != 1\n" +
174+ "branching: 1 0 1\n")
175+
118176 def testArmRunReturnVal(self):
119177 self.compileCheckArm(["-R", "/system/bin/accdata/data/returnval-ansi.c"],
120178 "Executing compiled code:\nresult: 42\n")