system/corennnnn
Revisão | fd3db48e2e066a36371fbd018082c7f5db8e37e5 (tree) |
---|---|
Hora | 2009-07-15 11:39:36 |
Autor | Jack Palevich <jackpal@goog...> |
Commiter | Jack Palevich |
Add test for passing floats and doubles as ints, floats, and doubles.
@@ -118,16 +118,16 @@ void testBranching() { | ||
118 | 118 | printf("branching: %d %d %d\n", branch(-1.0), branch(0.0), branch(1.0)); |
119 | 119 | } |
120 | 120 | |
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); | |
123 | 123 | } |
124 | 124 | |
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); | |
127 | 127 | } |
128 | 128 | |
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); | |
131 | 131 | } |
132 | 132 | |
133 | 133 | void testpassidf(int i, double d, float f) { |
@@ -135,9 +135,16 @@ void testpassidf(int i, double d, float f) { | ||
135 | 135 | } |
136 | 136 | |
137 | 137 | 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); | |
141 | 148 | testpassidf(1, 2.0, 3.0f); |
142 | 149 | } |
143 | 150 |
@@ -229,9 +229,15 @@ double op int: | ||
229 | 229 | 1 op 1: < 0 <= 1 == 1 >= 1 > 0 != 0 |
230 | 230 | 2 op 1: < 0 <= 0 == 0 >= 1 > 1 != 1 |
231 | 231 | 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 | |
235 | 241 | testpassidf: 1 2 3 |
236 | 242 | """) |
237 | 243 | def testCasts(self): |