• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

system/corennnnn


Commit MetaInfo

Revisãofd3db48e2e066a36371fbd018082c7f5db8e37e5 (tree)
Hora2009-07-15 11:39:36
AutorJack Palevich <jackpal@goog...>
CommiterJack Palevich

Mensagem de Log

Add test for passing floats and doubles as ints, floats, and doubles.

Mudança Sumário

Diff

--- a/libacc/tests/data/flops.c
+++ b/libacc/tests/data/flops.c
@@ -118,16 +118,16 @@ void testBranching() {
118118 printf("branching: %d %d %d\n", branch(-1.0), branch(0.0), branch(1.0));
119119 }
120120
121-void testpassi(int a, int b, int c, int d, int e, int f, int g, int h) {
122- printf("testpassi: %d %d %d %d %d %d %d %d\n", a, b, c, d, e, f, g, h);
121+void testpassi(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l) {
122+ printf("testpassi: %d %d %d %d %d %d %d %d %d %d %d %d\n", a, b, c, d, e, f, g, h, i, j, k, l);
123123 }
124124
125-void testpassf(float a, float b, float c, float d, float e, float f, float g, float h) {
126- printf("testpassf: %g %g %g %g %g %g %g %g\n", a, b, c, d, e, f, g, h);
125+void testpassf(float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l) {
126+ printf("testpassf: %g %g %g %g %g %g %g %g %g %g %g %g\n", a, b, c, d, e, f, g, h, i, j, k, l);
127127 }
128128
129-void testpassd(double a, double b, double c, double d, double e, double f, double g, double h) {
130- printf("testpassd: %g %g %g %g %g %g %g %g\n", a, b, c, d, e, f, g, h);
129+void testpassd(double a, double b, double c, double d, double e, double f, double g, double h, double i, double j, double k, double l) {
130+ printf("testpassd: %g %g %g %g %g %g %g %g %g %g %g %g\n", a, b, c, d, e, f, g, h, i, j, k, l);
131131 }
132132
133133 void testpassidf(int i, double d, float f) {
@@ -135,9 +135,16 @@ void testpassidf(int i, double d, float f) {
135135 }
136136
137137 void testParameterPassing() {
138- testpassi(1, 2, 3, 4, 5, 6, 7, 8);
139- testpassf(1, 2, 3, 4, 5, 6, 7, 8);
140- testpassd(1, 2, 3, 4, 5, 6, 7, 8);
138+ float x;
139+ testpassi(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
140+ testpassf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
141+ testpassd(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
142+ testpassi(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f);
143+ testpassf(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f);
144+ testpassd(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f);
145+ testpassi(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0);
146+ testpassf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0);
147+ testpassd(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0);
141148 testpassidf(1, 2.0, 3.0f);
142149 }
143150
--- a/libacc/tests/test.py
+++ b/libacc/tests/test.py
@@ -229,9 +229,15 @@ double op int:
229229 1 op 1: < 0 <= 1 == 1 >= 1 > 0 != 0
230230 2 op 1: < 0 <= 0 == 0 >= 1 > 1 != 1
231231 branching: 1 0 1
232-testpassi: 1 2 3 4 5 6 7 8
233-testpassf: 1 2 3 4 5 6 7 8
234-testpassd: 1 2 3 4 5 6 7 8
232+testpassi: 1 2 3 4 5 6 7 8 9 10 11 12
233+testpassf: 1 2 3 4 5 6 7 8 9 10 11 12
234+testpassd: 1 2 3 4 5 6 7 8 9 10 11 12
235+testpassi: 1 2 3 4 5 6 7 8 9 10 11 12
236+testpassf: 1 2 3 4 5 6 7 8 9 10 11 12
237+testpassd: 1 2 3 4 5 6 7 8 9 10 11 12
238+testpassi: 1 2 3 4 5 6 7 8 9 10 11 12
239+testpassf: 1 2 3 4 5 6 7 8 9 10 11 12
240+testpassd: 1 2 3 4 5 6 7 8 9 10 11 12
235241 testpassidf: 1 2 3
236242 """)
237243 def testCasts(self):