2003-12-06 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / structs.exp
1 # This testcase is part of GDB, the GNU debugger.
2
3 # Copyright 1996, 1997, 1999, 2003 Free Software Foundation, Inc.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 # Please email any bugs, comments, and/or additions to this file to:
20 # bug-gdb@prep.ai.mit.edu
21
22 if $tracelevel then {
23 strace $tracelevel
24 }
25
26 set prms_id 0
27 set bug_id 0
28
29 # Some targets can't call functions, so don't even bother with this
30 # test.
31
32 if [target_info exists gdb,cannot_call_functions] {
33 setup_xfail "*-*-*"
34 fail "This target can not call functions"
35 continue
36 }
37
38 set testfile "structs"
39 set srcfile ${testfile}.c
40 set binfile ${objdir}/${subdir}/${testfile}
41
42 # Create and source the file that provides information about the
43 # compiler used to compile the test case.
44
45 if [get_compiler_info ${binfile}] {
46 return -1;
47 }
48
49 # Compile a variant of structs.c using TYPES to specify the type of
50 # the first N struct elements (the remaining elements take the type of
51 # the last TYPES field). Run the compmiled program up to "main".
52 # Also updates the global "testfile" to reflect the most recent build.
53
54 proc start_structs_test { types } {
55 global testfile
56 global srcfile
57 global binfile
58 global objdir
59 global subdir
60 global srcdir
61 global gdb_prompt
62
63 # Create the additional flags
64 set flags "debug"
65 set testfile "structs"
66 set n 0
67 for {set n 0} {$n<[llength ${types}]} {incr n} {
68 set m [I2A ${n}]
69 set t [lindex ${types} $n]
70 lappend flags "additional_flags=-Dt${m}=${t}"
71 append testfile "-" "$t"
72 }
73
74 set binfile ${objdir}/${subdir}/${testfile}
75 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags}"] != "" } {
76 # built the second test case since we can't use prototypes
77 warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
78 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags} additional_flags=-DNO_PROTOTYPES"] != "" } {
79 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
80 }
81 }
82
83 # Start with a fresh gdb.
84 gdb_start
85 gdb_reinitialize_dir $srcdir/$subdir
86 gdb_load ${binfile}
87
88 # Make certain that the output is consistent
89 gdb_test "set print sevenbit-strings" "" \
90 "set print sevenbit-strings; ${testfile}"
91 gdb_test "set print address off" "" \
92 "set print address off; ${testfile}"
93 gdb_test "set width 0" "" \
94 "set width 0; ${testfile}"
95
96 # Advance to main
97 if { ![runto_main] } then {
98 gdb_suppress_tests;
99 }
100
101 # Get the debug format
102 get_debug_format
103
104 # check that at the struct containing all the relevant types is correct
105 set foo_t "type = struct struct[llength ${types}] \{"
106 for {set n 0} {$n<[llength ${types}]} {incr n} {
107 append foo_t "\[\r\n \]+[lindex ${types} $n] [i2a $n];"
108 }
109 append foo_t "\[\r\n \]+\}"
110 gdb_test "ptype foo[llength ${types}]" "${foo_t}" \
111 "ptype foo[llength ${types}]; ${testfile}"
112 }
113
114 # The expected value for fun${n}, L${n} and foo${n}. First element is
115 # empty to make indexing easier. "foo" returns the modified value,
116 # "zed" returns the invalid value.
117
118 proc foo { n } {
119 return [lindex {
120 "{}"
121 "{a = 49 '1'}"
122 "{a = 97 'a', b = 50 '2'}"
123 "{a = 49 '1', b = 98 'b', c = 51 '3'}"
124 "{a = 97 'a', b = 50 '2', c = 99 'c', d = 52 '4'}"
125 "{a = 49 '1', b = 98 'b', c = 51 '3', d = 100 'd', e = 53 '5'}"
126 "{a = 97 'a', b = 50 '2', c = 99 'c', d = 52 '4', e = 101 'e', f = 54 '6'}"
127 "{a = 49 '1', b = 98 'b', c = 51 '3', d = 100 'd', e = 53 '5', f = 102 'f', g = 55 '7'}"
128 "{a = 97 'a', b = 50 '2', c = 99 'c', d = 52 '4', e = 101 'e', f = 54 '6', g = 103 'g', h = 56 '8'}"
129 "{a = 49 '1', b = 98 'b', c = 51 '3', d = 100 'd', e = 53 '5', f = 102 'f', g = 55 '7', h = 104 'h', i = 57 '9'}"
130 "{a = 97 'a', b = 50 '2', c = 99 'c', d = 52 '4', e = 101 'e', f = 54 '6', g = 103 'g', h = 56 '8', i = 105 'i', j = 65 'A'}"
131 "{a = 49 '1', b = 98 'b', c = 51 '3', d = 100 'd', e = 53 '5', f = 102 'f', g = 55 '7', h = 104 'h', i = 57 '9', j = 106 'j', k = 66 'B'}"
132 "{a = 97 'a', b = 50 '2', c = 99 'c', d = 52 '4', e = 101 'e', f = 54 '6', g = 103 'g', h = 56 '8', i = 105 'i', j = 65 'A', k = 107 'k', l = 67 'C'}"
133 "{a = 49 '1', b = 98 'b', c = 51 '3', d = 100 'd', e = 53 '5', f = 102 'f', g = 55 '7', h = 104 'h', i = 57 '9', j = 106 'j', k = 66 'B', l = 108 'l', m = 68 'D'}"
134 "{a = 97 'a', b = 50 '2', c = 99 'c', d = 52 '4', e = 101 'e', f = 54 '6', g = 103 'g', h = 56 '8', i = 105 'i', j = 65 'A', k = 107 'k', l = 67 'C', m = 109 'm', n = 69 'E'}"
135 "{a = 49 '1', b = 98 'b', c = 51 '3', d = 100 'd', e = 53 '5', f = 102 'f', g = 55 '7', h = 104 'h', i = 57 '9', j = 106 'j', k = 66 'B', l = 108 'l', m = 68 'D', n = 110 'n', o = 70 'F'}"
136 "{a = 97 'a', b = 50 '2', c = 99 'c', d = 52 '4', e = 101 'e', f = 54 '6', g = 103 'g', h = 56 '8', i = 105 'i', j = 65 'A', k = 107 'k', l = 67 'C', m = 109 'm', n = 69 'E', o = 111 'o', p = 71 'G'}"
137 "{a = 49 '1', b = 98 'b', c = 51 '3', d = 100 'd', e = 53 '5', f = 102 'f', g = 55 '7', h = 104 'h', i = 57 '9', j = 106 'j', k = 66 'B', l = 108 'l', m = 68 'D', n = 110 'n', o = 70 'F', p = 112 'p', q = 72 'H'}"
138 } $n]
139 }
140
141 proc zed { n } {
142 return [lindex {
143 "{}"
144 "{a = 90 'Z'}"
145 "{a = 90 'Z', b = 90 'Z'}"
146 "{a = 90 'Z', b = 90 'Z', c = 90 'Z'}"
147 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z'}"
148 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z'}"
149 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z'}"
150 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z'}"
151 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z', h = 90 'Z'}"
152 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z', h = 90 'Z', i = 90 'Z'}"
153 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z', h = 90 'Z', i = 90 'Z', j = 90 'Z'}"
154 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z', h = 90 'Z', i = 90 'Z', j = 90 'Z', k = 90 'Z'}"
155 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z', h = 90 'Z', i = 90 'Z', j = 90 'Z', k = 90 'Z', l = 90 'Z'}"
156 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z', h = 90 'Z', i = 90 'Z', j = 90 'Z', k = 90 'Z', l = 90 'Z', m = 90 'Z'}"
157 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z', h = 90 'Z', i = 90 'Z', j = 90 'Z', k = 90 'Z', l = 90 'Z', m = 90 'Z', n = 90 'Z'}"
158 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z', h = 90 'Z', i = 90 'Z', j = 90 'Z', k = 90 'Z', l = 90 'Z', m = 90 'Z', n = 90 'Z', o = 90 'Z'}"
159 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z', h = 90 'Z', i = 90 'Z', j = 90 'Z', k = 90 'Z', l = 90 'Z', m = 90 'Z', n = 90 'Z', o = 90 'Z', p = 90 'Z'}"
160 "{a = 90 'Z', b = 90 'Z', c = 90 'Z', d = 90 'Z', e = 90 'Z', f = 90 'Z', g = 90 'Z', h = 90 'Z', i = 90 'Z', j = 90 'Z', k = 90 'Z', l = 90 'Z', m = 90 'Z', n = 90 'Z', o = 90 'Z', p = 90 'Z', q = 90 'Z'}"
161 } $n]
162 }
163
164 # Given N (0..25), return the corresponding alphabetic letter in lower
165 # or upper case. This is ment to be i18n proof.
166
167 proc i2a { n } {
168 return [string range "abcdefghijklmnopqrstuvwxyz" $n $n]
169 }
170
171 proc I2A { n } {
172 return [string toupper [i2a $n]]
173 }
174
175
176 # Use the file name, compiler and tuples to set up any needed KFAILs.
177
178 proc setup_kfails { file tuples bug } {
179 global testfile
180 if [string match $file $testfile] {
181 foreach f $tuples { setup_kfail $f $bug }
182 }
183 }
184
185 proc setup_compiler_kfails { file compiler format tuples bug } {
186 global testfile
187 if {[string match $file $testfile] && [test_compiler_info $compiler] && [test_debug_format $format]} {
188 foreach f $tuples { setup_kfail $f $bug }
189 }
190 }
191
192 # Test GDB's ability to make inferior function calls to functions
193 # returning (or passing in a single structs.
194
195 # N identifies the number of elements in the struct that will be used
196 # for the test case. FAILS is a list of target tuples that will fail
197 # this test.
198
199 # start_structs_test() will have previously built a program with a
200 # specified combination of types for those elements. To ensure
201 # robustness of the output, "p/c" is used.
202
203 # This tests the code paths "which return-value convention?" and
204 # "extract return-value from registers" called by "infcall.c".
205
206 proc test_struct_calls { n } {
207 global testfile
208 global gdb_prompt
209
210 # Check that GDB can always extract a struct-return value from an
211 # inferior function call. Since GDB always knows the location of an
212 # inferior function call's return value these should never fail
213
214 # Implemented by calling the parameterless function "fun$N" and then
215 # examining the return value printed by GDB.
216
217 set tests "call $n ${testfile}"
218
219 # Call fun${n}, checking the printed return-value.
220 setup_kfails structs-*tld* i*86-*-* gdb/1447
221 setup_compiler_kfails structs-tc-* gcc-3-3 "DWARF 2" i*86-*-* gdb/1455
222 gdb_test "p/c fun${n}()" "[foo ${n}]" "p/c fun<n>(); ${tests}"
223
224 # Check that GDB can always pass a structure to an inferior function.
225 # This test can never fail.
226
227 # Implemented by calling the one parameter function "Fun$N" which
228 # stores its parameter in the global variable "L$N". GDB then
229 # examining that global to confirm that the value is as expected.
230
231 gdb_test "call Fun${n}(foo${n})" "" "call Fun<n>(foo<n>); ${tests}"
232 setup_kfails structs-*tld* i*86-*-* gdb/1447
233 setup_compiler_kfails structs-tc-* gcc-3-3 "DWARF 2" i*86-*-* gdb/1455
234 gdb_test "p/c L${n}" [foo ${n}] "p/c L<n>; ${tests}"
235 }
236
237 # Test GDB's ability to both return a function (with "return" or
238 # "finish") and correctly extract/store any corresponding
239 # return-value.
240
241 # Check that GDB can consistently extract/store structure return
242 # values. There are two cases - returned in registers and returned in
243 # memory. For the latter case, the return value can't be found and a
244 # failure is "expected". However GDB must still both return the
245 # function and display the final source and line information.
246
247 # N identifies the number of elements in the struct that will be used
248 # for the test case. FAILS is a list of target tuples that will fail
249 # this test.
250
251 # This tests the code paths "which return-value convention?", "extract
252 # return-value from registers", and "store return-value in registers".
253 # Unlike "test struct calls", this test is expected to "fail" when the
254 # return-value is in memory (GDB can't find the location). The test
255 # is in three parts: test "return"; test "finish"; check that the two
256 # are consistent. GDB can sometimes work for one command and not the
257 # other.
258
259 proc test_struct_returns { n } {
260 global gdb_prompt
261 global testfile
262
263 set tests "return $n ${testfile}"
264
265
266 # Check that "return" works.
267
268 # GDB must always force the return of a function that has
269 # a struct result. Dependant on the ABI, it may, or may not be
270 # possible to store the return value in a register.
271
272 # The relevant code looks like "L{n} = fun{n}()". The test forces
273 # "fun{n}" to "return" with an explicit value. Since that code
274 # snippet will store the the returned value in "L{n}" the return
275 # is tested by examining "L{n}". This assumes that the
276 # compiler implemented this as fun{n}(&L{n}) and hence that when
277 # the value isn't stored "L{n}" remains unchanged. Also check for
278 # consistency between this and the "finish" case.
279
280 # Get into a call of fun${n}
281 gdb_test "advance fun${n}" \
282 "fun${n} .*\[\r\n\]+\[0-9\].*return foo${n}.*" \
283 "advance to fun<n> for return; ${tests}"
284
285 # Check that the program invalidated the relevant global.
286 setup_kfails structs-tld i*86-*-* gdb/1447
287 gdb_test "p/c L${n}" " = [zed $n]" "zed L<n> for return; ${tests} .${testfile}."
288
289 # Force the "return". This checks that the return is always
290 # performed, and that GDB correctly reported this to the user.
291 # GDB 6.0 and earlier, when the return-value's location wasn't
292 # known, both failed to print a final "source and line" and misplaced
293 # the frame ("No frame").
294
295 # The test is writen so that it only reports one FAIL/PASS for the
296 # entire operation. The value returned is checked further down.
297 # "return_value_unknown", if non-empty, records why GDB realised
298 # that it didn't know where the return value was.
299
300 set test "return foo<n>; ${tests}"
301 set return_value_unknown 0
302 set return_value_unimplemented 0
303 gdb_test_multiple "return foo${n}" "${test}" {
304 -re "The location" {
305 # Ulgh, a struct return, remember this (still need prompt).
306 set return_value_unknown 1
307 exp_continue
308 }
309 -re "A structure or union" {
310 # Ulgh, a struct return, remember this (still need prompt).
311 set return_value_unknown 1
312 # Double ulgh. Architecture doesn't use return_value and
313 # hence hasn't implemented small structure return.
314 set return_value_unimplemented 1
315 exp_continue
316 }
317 -re "Make fun${n} return now.*y or n. $" {
318 gdb_test_multiple "y" "${test}" {
319 -re "L${n} *= fun${n}.*${gdb_prompt} $" {
320 # Need to step off the function call
321 gdb_test "next" "L.* *= fun.*" "${test}"
322 }
323 -re "L[expr ${n} + 1] *= fun[expr ${n} + 1].*${gdb_prompt} $" {
324 pass "${test}"
325 }
326 }
327 }
328 }
329
330 # Check that the return-value is as expected. At this stage we're
331 # just checking that GDB has returned a value consistent with
332 # "return_value_unknown" set above.
333
334 set test "value foo<n> returned; ${tests}"
335 setup_kfails structs-*tld* i*86-*-* gdb/1447
336 gdb_test_multiple "p/c L${n}" "${test}" {
337 -re " = [foo ${n}].*${gdb_prompt} $" {
338 if $return_value_unknown {
339 # This contradicts the above claim that GDB didn't
340 # know the location of the return-value.
341 fail "${test}"
342 } else {
343 pass "${test}"
344 }
345 }
346 -re " = [zed ${n}].*${gdb_prompt} $" {
347 if $return_value_unknown {
348 # The struct return case. Since any modification
349 # would be by reference, and that can't happen, the
350 # value should be unmodified and hence Z is expected.
351 # Is this a reasonable assumption?
352 pass "${test}"
353 } else {
354 # This contradicts the above claim that GDB knew
355 # the location of the return-value.
356 fail "${test}"
357 }
358 }
359 -re ".*${gdb_prompt} $" {
360 if $return_value_unimplemented {
361 # What a suprize. The architecture hasn't implemented
362 # return_value, and hence has to fail.
363 kfail "$test" gdb/1444
364 } else {
365 fail "$test"
366 }
367 }
368 }
369
370 # Check that a "finish" works.
371
372 # This is almost but not quite the same as "call struct funcs".
373 # Architectures can have subtle differences in the two code paths.
374
375 # The relevant code snippet is "L{n} = fun{n}()". The program is
376 # advanced into a call to "fun{n}" and then that function is
377 # finished. The returned value that GDB prints, reformatted using
378 # "p/c", is checked.
379
380 # Get into "fun${n}()".
381 gdb_test "advance fun${n}" \
382 "fun${n} .*\[\r\n\]+\[0-9\].*return foo${n}.*" \
383 "advance to fun<n> for finish; ${tests}"
384
385 # Check that the program invalidated the relevant global.
386 setup_kfails structs-tld i*86-*-* gdb/1447
387 gdb_test "p/c L${n}" " = [zed $n]" "zed L<n> for finish; ${tests}"
388
389 # Finish the function, set 'finish_value_unknown" to non-empty if the
390 # return-value was not found.
391 set test "finish foo<n>; ${tests}"
392 set finish_value_unknown 0
393 gdb_test_multiple "finish" "${test}" {
394 -re "Value returned is .*${gdb_prompt} $" {
395 pass "${test}"
396 }
397 -re "Cannot determine contents.*${gdb_prompt} $" {
398 # Expected bad value. For the moment this is ok.
399 set finish_value_unknown 1
400 pass "${test}"
401 }
402 }
403
404 # Re-print the last (return-value) using the more robust
405 # "p/c". If no return value was found, the 'Z' from the previous
406 # check that the variable was cleared, is printed.
407 set test "value foo<n> finished; ${tests}"
408 setup_kfails structs-*tld* i*86-*-* gdb/1447
409 gdb_test_multiple "p/c" "${test}" {
410 -re "[foo ${n}]\[\r\n\]+${gdb_prompt} $" {
411 if $finish_value_unknown {
412 # This contradicts the above claim that GDB didn't
413 # know the location of the return-value.
414 fail "${test}"
415 } else {
416 pass "${test}"
417 }
418 }
419 -re "[zed ${n}]\[\r\n\]+${gdb_prompt} $" {
420 # The value didn't get found. This is "expected".
421 if $finish_value_unknown {
422 pass "${test}"
423 } else {
424 # This contradicts the above claim that GDB did
425 # know the location of the return-value.
426 fail "${test}"
427 }
428 }
429 }
430
431 # Finally, check that "return" and finish" have consistent
432 # behavior.
433
434 # Since both "return" and "finish" use equivalent "which
435 # return-value convention" logic, both commands should have
436 # identical can/can-not find return-value messages.
437
438 # Note that since "call" and "finish" use common code paths, a
439 # failure here is a strong indicator of problems with "store
440 # return-value" code paths. Suggest looking at "return_value"
441 # when investigating a fix.
442
443 set test "return and finish use same convention; ${tests}"
444 if {$finish_value_unknown == $return_value_unknown} {
445 pass "${test}"
446 } else {
447 kfail gdb/1444 "${test}"
448 }
449 }
450
451 # ABIs pass anything >8 or >16 bytes in memory but below that things
452 # randomly use register and/and structure conventions. Check all
453 # possible sized char structs in that range. But only a restricted
454 # range of the other types.
455
456 # NetBSD/PPC returns "unnatural" (3, 5, 6, 7) sized structs in memory.
457
458 # d10v is weird. 5/6 byte structs go in memory. 2 or more char
459 # structs go in memory. Everything else is in a register!
460
461 # Test every single char struct from 1..17 in size. This is what the
462 # original "structs" test was doing.
463
464 start_structs_test { tc }
465 test_struct_calls 1
466 test_struct_calls 2
467 test_struct_calls 3
468 test_struct_calls 4
469 test_struct_calls 5
470 test_struct_calls 6
471 test_struct_calls 7
472 test_struct_calls 8
473 test_struct_calls 9
474 test_struct_calls 10
475 test_struct_calls 11
476 test_struct_calls 12
477 test_struct_calls 13
478 test_struct_calls 14
479 test_struct_calls 15
480 test_struct_calls 16
481 test_struct_calls 17
482 test_struct_returns 1
483 test_struct_returns 2
484 test_struct_returns 3
485 test_struct_returns 4
486 test_struct_returns 5
487 test_struct_returns 6
488 test_struct_returns 7
489 test_struct_returns 8
490
491
492 # Let the fun begin.
493
494 # Assuming that any integer struct larger than 8 bytes goes in memory,
495 # come up with many and varied combinations of a return struct. For
496 # "struct calls" test just beyond that 8 byte boundary, for "struct
497 # returns" test up to that boundary.
498
499 # For floats, assumed that up to two struct elements can be stored in
500 # floating point registers, regardless of their size.
501
502 # The approx size of each structure it is computed assumed that tc=1,
503 # ts=2, ti=4, tl=4, tll=8, tf=4, td=8, tld=16, and that all fields are
504 # naturally aligned. Padding being added where needed. Note that
505 # these numbers are just approx, the d10v has ti=2, a 64-bit has has
506 # tl=8.
507
508 # Approx size: 2, 4, ...
509 start_structs_test { ts }
510 test_struct_calls 1
511 test_struct_calls 2
512 test_struct_calls 3
513 test_struct_calls 4
514 test_struct_calls 5
515 test_struct_returns 1
516 test_struct_returns 2
517 test_struct_returns 3
518 test_struct_returns 4
519
520 # Approx size: 4, 8, ...
521 start_structs_test { ti }
522 test_struct_calls 1
523 test_struct_calls 2
524 test_struct_calls 3
525 test_struct_returns 1
526 test_struct_returns 2
527
528 # Approx size: 4, 8, ...
529 start_structs_test { tl }
530 test_struct_calls 1
531 test_struct_calls 2
532 test_struct_calls 3
533 test_struct_returns 1
534 test_struct_returns 2
535
536 # Approx size: 8, 16, ...
537 start_structs_test { tll }
538 test_struct_calls 1
539 test_struct_calls 2
540 test_struct_returns 1
541
542 # Approx size: 4, 8, ...
543 start_structs_test { tf }
544 test_struct_calls 1
545 test_struct_calls 2
546 test_struct_calls 3
547 test_struct_returns 1
548 test_struct_returns 2
549
550 # Approx size: 8, 16, ...
551 start_structs_test { td }
552 test_struct_calls 1
553 test_struct_calls 2
554 test_struct_returns 1
555
556 # Approx size: 16, 32, ...
557 start_structs_test { tld }
558 test_struct_calls 1
559 test_struct_calls 2
560 test_struct_returns 1
561
562 # Approx size: 2+1=3, 4, ...
563 start_structs_test { ts tc }
564 test_struct_calls 2
565 test_struct_calls 3
566 test_struct_calls 4
567 test_struct_calls 5
568 test_struct_calls 6
569 test_struct_calls 7
570 test_struct_calls 8
571 test_struct_returns 2
572
573 # Approx size: 4+1=5, 6, ...
574 start_structs_test { ti tc }
575 test_struct_calls 2
576 test_struct_calls 3
577 test_struct_calls 4
578 test_struct_calls 5
579 test_struct_calls 6
580 test_struct_returns 2
581
582 # Approx size: 4+1=5, 6, ...
583 start_structs_test { tl tc }
584 test_struct_calls 2
585 test_struct_calls 3
586 test_struct_calls 4
587 test_struct_calls 5
588 test_struct_calls 6
589 test_struct_returns 2
590
591 # Approx size: 8+1=9, 10, ...
592 start_structs_test { tll tc }
593 test_struct_calls 2
594
595 # Approx size: 4+1=5, 6, ...
596 start_structs_test { tf tc }
597 test_struct_calls 2
598 test_struct_calls 3
599 test_struct_calls 4
600 test_struct_calls 5
601 test_struct_calls 6
602 test_struct_returns 2
603
604 # Approx size: 8+1=9, 10, ...
605 start_structs_test { td tc }
606 test_struct_calls 2
607
608 # Approx size: 16+1=17, 18, ...
609 start_structs_test { tld tc }
610 test_struct_calls 2
611
612 # Approx size: (1+1)+2=4, 6, ...
613 start_structs_test { tc ts }
614 test_struct_calls 2
615 test_struct_calls 3
616 test_struct_calls 4
617 test_struct_calls 5
618 test_struct_calls 6
619 test_struct_returns 2
620
621 # Approx size: (1+3)+4=8, 12, ...
622 start_structs_test { tc ti }
623 test_struct_calls 2
624 test_struct_calls 3
625 test_struct_calls 4
626 test_struct_returns 2
627
628 # Approx size: (1+3)+4=8, 12, ...
629 start_structs_test { tc tl }
630 test_struct_calls 2
631 test_struct_calls 3
632 test_struct_calls 4
633 test_struct_returns 2
634
635 # Approx size: (1+7)+8=16, 24, ...
636 start_structs_test { tc tll }
637 test_struct_calls 2
638
639 # Approx size: (1+3)+4=8, 12, ...
640 start_structs_test { tc tf }
641 test_struct_calls 2
642 test_struct_calls 3
643 test_struct_calls 4
644
645 # Approx size: (1+7)+8=16, 24, ...
646 start_structs_test { tc td }
647 test_struct_calls 2
648
649 # Approx size: (1+15)+16=32, 48, ...
650 start_structs_test { tc tld }
651 test_struct_calls 2
652
653 # Some float combinations
654
655 # Approx size: 8+4=12, 16, ...
656 # d10v: 4+4=8, 12, ...
657 start_structs_test { td tf }
658 test_struct_calls 2
659 test_struct_returns 2
660
661 # Approx size: (4+4)+8=16, 32, ...
662 # d10v: 4+4=8, 12, ...
663 start_structs_test { tf td }
664 test_struct_calls 2
665 test_struct_returns 2
666
667 return 0
This page took 0.059327 seconds and 5 git commands to generate.