Debian Codegraph @

tests/testsuite

raw
1 #! /bin/sh
2 # Generated from testsuite.at by GNU Autoconf 2.71.
3 #
4 # Copyright (C) 2009-2017, 2020-2021 Free Software Foundation, Inc.
5 #
6 # This test suite is free software; the Free Software Foundation gives
7 # unlimited permission to copy, distribute and modify it.
8 ## -------------------- ##
9 ## M4sh Initialization. ##
10 ## -------------------- ##
11
12 # Be more Bourne compatible
13 DUALCASE=1; export DUALCASE # for MKS sh
14 as_nop=:
15 if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
16 then :
17 emulate sh
18 NULLCMD=:
19 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
20 # is contrary to our usage. Disable this feature.
21 alias -g '${1+"$@"}'='"$@"'
22 setopt NO_GLOB_SUBST
23 else $as_nop
24 case `(set -o) 2>/dev/null` in #(
25 *posix*) :
26 set -o posix ;; #(
27 *) :
28 ;;
29 esac
30 fi
31
32
33
34 # Reset variables that may have inherited troublesome values from
35 # the environment.
36
37 # IFS needs to be set, to space, tab, and newline, in precisely that order.
38 # (If _AS_PATH_WALK were called with IFS unset, it would have the
39 # side effect of setting IFS to empty, thus disabling word splitting.)
40 # Quoting is to prevent editors from complaining about space-tab.
41 as_nl='
42 '
43 export as_nl
44 IFS=" "" $as_nl"
45
46 PS1='$ '
47 PS2='> '
48 PS4='+ '
49
50 # Ensure predictable behavior from utilities with locale-dependent output.
51 LC_ALL=C
52 export LC_ALL
53 LANGUAGE=C
54 export LANGUAGE
55
56 # We cannot yet rely on "unset" to work, but we need these variables
57 # to be unset--not just set to an empty or harmless value--now, to
58 # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
59 # also avoids known problems related to "unset" and subshell syntax
60 # in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
61 for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
62 do eval test \${$as_var+y} \
63 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
64 done
65
66 # Ensure that fds 0, 1, and 2 are open.
67 if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
68 if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
69 if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
70
71 # The user is always right.
72 if ${PATH_SEPARATOR+false} :; then
73 PATH_SEPARATOR=:
74 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
75 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
76 PATH_SEPARATOR=';'
77 }
78 fi
79
80
81 # Find who we are. Look in the path if we contain no directory separator.
82 as_myself=
83 case $0 in #((
84 *[\\/]* ) as_myself=$0 ;;
85 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
86 for as_dir in $PATH
87 do
88 IFS=$as_save_IFS
89 case $as_dir in #(((
90 '') as_dir=./ ;;
91 */) ;;
92 *) as_dir=$as_dir/ ;;
93 esac
94 test -r "$as_dir$0" && as_myself=$as_dir$0 && break
95 done
96 IFS=$as_save_IFS
97
98 ;;
99 esac
100 # We did not find ourselves, most probably we were run as `sh COMMAND'
101 # in which case we are not to be found in the path.
102 if test "x$as_myself" = x; then
103 as_myself=$0
104 fi
105 if test ! -f "$as_myself"; then
106 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
107 exit 1
108 fi
109
110
111 if test "x$CONFIG_SHELL" = x; then
112 as_bourne_compatible="as_nop=:
113 if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
114 then :
115 emulate sh
116 NULLCMD=:
117 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
118 # is contrary to our usage. Disable this feature.
119 alias -g '\${1+\"\$@\"}'='\"\$@\"'
120 setopt NO_GLOB_SUBST
121 else \$as_nop
122 case \`(set -o) 2>/dev/null\` in #(
123 *posix*) :
124 set -o posix ;; #(
125 *) :
126 ;;
127 esac
128 fi
129 "
130 as_required="as_fn_return () { (exit \$1); }
131 as_fn_success () { as_fn_return 0; }
132 as_fn_failure () { as_fn_return 1; }
133 as_fn_ret_success () { return 0; }
134 as_fn_ret_failure () { return 1; }
135
136 exitcode=0
137 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
138 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
139 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
140 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
141 if ( set x; as_fn_ret_success y && test x = \"\$1\" )
142 then :
143
144 else \$as_nop
145 exitcode=1; echo positional parameters were not saved.
146 fi
147 test x\$exitcode = x0 || exit 1
148 blah=\$(echo \$(echo blah))
149 test x\"\$blah\" = xblah || exit 1
150 test -x / || exit 1"
151 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
152 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
153 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
154 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
155 test \$(( 1 + 1 )) = 2 || exit 1"
156 if (eval "$as_required") 2>/dev/null
157 then :
158 as_have_required=yes
159 else $as_nop
160 as_have_required=no
161 fi
162 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
163 then :
164
165 else $as_nop
166 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
167 as_found=false
168 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
169 do
170 IFS=$as_save_IFS
171 case $as_dir in #(((
172 '') as_dir=./ ;;
173 */) ;;
174 *) as_dir=$as_dir/ ;;
175 esac
176 as_found=:
177 case $as_dir in #(
178 /*)
179 for as_base in sh bash ksh sh5; do
180 # Try only shells that exist, to save several forks.
181 as_shell=$as_dir$as_base
182 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
183 as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
184 then :
185 CONFIG_SHELL=$as_shell as_have_required=yes
186 if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
187 then :
188 break 2
189 fi
190 fi
191 done;;
192 esac
193 as_found=false
194 done
195 IFS=$as_save_IFS
196 if $as_found
197 then :
198
199 else $as_nop
200 if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
201 as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
202 then :
203 CONFIG_SHELL=$SHELL as_have_required=yes
204 fi
205 fi
206
207
208 if test "x$CONFIG_SHELL" != x
209 then :
210 export CONFIG_SHELL
211 # We cannot yet assume a decent shell, so we have to provide a
212 # neutralization value for shells without unset; and this also
213 # works around shells that cannot unset nonexistent variables.
214 # Preserve -v and -x to the replacement shell.
215 BASH_ENV=/dev/null
216 ENV=/dev/null
217 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
218 case $- in # ((((
219 *v*x* | *x*v* ) as_opts=-vx ;;
220 *v* ) as_opts=-v ;;
221 *x* ) as_opts=-x ;;
222 * ) as_opts= ;;
223 esac
224 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
225 # Admittedly, this is quite paranoid, since all the known shells bail
226 # out after a failed `exec'.
227 printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
228 exit 255
229 fi
230
231 if test x$as_have_required = xno
232 then :
233 printf "%s\n" "$0: This script requires a shell more modern than all"
234 printf "%s\n" "$0: the shells that I found on your system."
235 if test ${ZSH_VERSION+y} ; then
236 printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
237 printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
238 else
239 printf "%s\n" "$0: Please tell [email protected] about your system,
240 $0: including any error possibly output before this
241 $0: message. Then install a modern shell, or manually run
242 $0: the script under such a shell if you do have one."
243 fi
244 exit 1
245 fi
246 fi
247 fi
248 SHELL=${CONFIG_SHELL-/bin/sh}
249 export SHELL
250 # Unset more variables known to interfere with behavior of common tools.
251 CLICOLOR_FORCE= GREP_OPTIONS=
252 unset CLICOLOR_FORCE GREP_OPTIONS
253
254 ## --------------------- ##
255 ## M4sh Shell Functions. ##
256 ## --------------------- ##
257 # as_fn_unset VAR
258 # ---------------
259 # Portably unset VAR.
260 as_fn_unset ()
261 {
262 { eval $1=; unset $1;}
263 }
264 as_unset=as_fn_unset
265
266
267 # as_fn_set_status STATUS
268 # -----------------------
269 # Set $? to STATUS, without forking.
270 as_fn_set_status ()
271 {
272 return $1
273 } # as_fn_set_status
274
275 # as_fn_exit STATUS
276 # -----------------
277 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
278 as_fn_exit ()
279 {
280 set +e
281 as_fn_set_status $1
282 exit $1
283 } # as_fn_exit
284 # as_fn_nop
285 # ---------
286 # Do nothing but, unlike ":", preserve the value of $?.
287 as_fn_nop ()
288 {
289 return $?
290 }
291 as_nop=as_fn_nop
292
293 # as_fn_mkdir_p
294 # -------------
295 # Create "$as_dir" as a directory, including parents if necessary.
296 as_fn_mkdir_p ()
297 {
298
299 case $as_dir in #(
300 -*) as_dir=./$as_dir;;
301 esac
302 test -d "$as_dir" || eval $as_mkdir_p || {
303 as_dirs=
304 while :; do
305 case $as_dir in #(
306 *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
307 *) as_qdir=$as_dir;;
308 esac
309 as_dirs="'$as_qdir' $as_dirs"
310 as_dir=`$as_dirname -- "$as_dir" ||
311 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
312 X"$as_dir" : 'X\(//\)[^/]' \| \
313 X"$as_dir" : 'X\(//\)$' \| \
314 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
315 printf "%s\n" X"$as_dir" |
316 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
317 s//\1/
318 q
319 }
320 /^X\(\/\/\)[^/].*/{
321 s//\1/
322 q
323 }
324 /^X\(\/\/\)$/{
325 s//\1/
326 q
327 }
328 /^X\(\/\).*/{
329 s//\1/
330 q
331 }
332 s/.*/./; q'`
333 test -d "$as_dir" && break
334 done
335 test -z "$as_dirs" || eval "mkdir $as_dirs"
336 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
337
338
339 } # as_fn_mkdir_p
340
341 # as_fn_executable_p FILE
342 # -----------------------
343 # Test if FILE is an executable regular file.
344 as_fn_executable_p ()
345 {
346 test -f "$1" && test -x "$1"
347 } # as_fn_executable_p
348 # as_fn_append VAR VALUE
349 # ----------------------
350 # Append the text in VALUE to the end of the definition contained in VAR. Take
351 # advantage of any shell optimizations that allow amortized linear growth over
352 # repeated appends, instead of the typical quadratic growth present in naive
353 # implementations.
354 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
355 then :
356 eval 'as_fn_append ()
357 {
358 eval $1+=\$2
359 }'
360 else $as_nop
361 as_fn_append ()
362 {
363 eval $1=\$$1\$2
364 }
365 fi # as_fn_append
366
367 # as_fn_arith ARG...
368 # ------------------
369 # Perform arithmetic evaluation on the ARGs, and store the result in the
370 # global $as_val. Take advantage of shells that can avoid forks. The arguments
371 # must be portable across $(()) and expr.
372 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
373 then :
374 eval 'as_fn_arith ()
375 {
376 as_val=$(( $* ))
377 }'
378 else $as_nop
379 as_fn_arith ()
380 {
381 as_val=`expr "$@" || test $? -eq 1`
382 }
383 fi # as_fn_arith
384
385
386 # as_fn_error STATUS ERROR [LINENO LOG_FD]
387 # ----------------------------------------
388 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
389 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
390 # script with STATUS, using 1 if that was 0.
391 as_fn_error ()
392 {
393 as_status=$1; test $as_status -eq 0 && as_status=1
394 if test "$4"; then
395 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
396 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
397 fi
398 printf "%s\n" "$as_me: error: $2" >&2
399 as_fn_exit $as_status
400 } # as_fn_error
401
402 if expr a : '\(a\)' >/dev/null 2>&1 &&
403 test "X`expr 00001 : '.*\(...\)'`" = X001; then
404 as_expr=expr
405 else
406 as_expr=false
407 fi
408
409 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
410 as_basename=basename
411 else
412 as_basename=false
413 fi
414
415 as_me=`$as_basename -- "$0" ||
416 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
417 X"$0" : 'X\(//\)$' \| \
418 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
419 printf "%s\n" X/"$0" |
420 sed '/^.*\/\([^/][^/]*\)\/*$/{
421 s//\1/
422 q
423 }
424 /^X\/\(\/\/\)$/{
425 s//\1/
426 q
427 }
428 /^X\/\(\/\).*/{
429 s//\1/
430 q
431 }
432 s/.*/./; q'`
433
434 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
435 as_dirname=dirname
436 else
437 as_dirname=false
438 fi
439
440 # Avoid depending upon Character Ranges.
441 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
442 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
443 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
444 as_cr_digits='0123456789'
445 as_cr_alnum=$as_cr_Letters$as_cr_digits
446
447
448 as_lineno_1=$LINENO as_lineno_1a=$LINENO
449 as_lineno_2=$LINENO as_lineno_2a=$LINENO
450 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
451 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
452 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
453 sed -n '
454 p
455 /[$]LINENO/=
456 ' <$as_myself |
457 sed '
458 s/[$]LINENO.*/&-/
459 t lineno
460 b
461 :lineno
462 N
463 :loop
464 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
465 t loop
466 s/-\n.*//
467 ' >$as_me.lineno &&
468 chmod +x "$as_me.lineno" ||
469 { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
470
471 # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
472 # already done that, so ensure we don't try to do so again and fall
473 # in an infinite loop. This has already happened in practice.
474 _as_can_reexec=no; export _as_can_reexec
475 # Don't try to exec as it changes $[0], causing all sort of problems
476 # (the dirname of $[0] is not the place where we might find the
477 # original and so on. Autoconf is especially sensitive to this).
478 . "./$as_me.lineno"
479 # Exit status is that of the last command.
480 exit
481 }
482
483
484 # Determine whether it's possible to make 'echo' print without a newline.
485 # These variables are no longer used directly by Autoconf, but are AC_SUBSTed
486 # for compatibility with existing Makefiles.
487 ECHO_C= ECHO_N= ECHO_T=
488 case `echo -n x` in #(((((
489 -n*)
490 case `echo 'xy\c'` in
491 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
492 xy) ECHO_C='\c';;
493 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
494 ECHO_T=' ';;
495 esac;;
496 *)
497 ECHO_N='-n';;
498 esac
499
500 # For backward compatibility with old third-party macros, we provide
501 # the shell variables $as_echo and $as_echo_n. New code should use
502 # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
503 as_echo='printf %s\n'
504 as_echo_n='printf %s'
505
506
507 rm -f conf$$ conf$$.exe conf$$.file
508 if test -d conf$$.dir; then
509 rm -f conf$$.dir/conf$$.file
510 else
511 rm -f conf$$.dir
512 mkdir conf$$.dir 2>/dev/null
513 fi
514 if (echo >conf$$.file) 2>/dev/null; then
515 if ln -s conf$$.file conf$$ 2>/dev/null; then
516 as_ln_s='ln -s'
517 # ... but there are two gotchas:
518 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
519 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
520 # In both cases, we have to default to `cp -pR'.
521 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
522 as_ln_s='cp -pR'
523 elif ln conf$$.file conf$$ 2>/dev/null; then
524 as_ln_s=ln
525 else
526 as_ln_s='cp -pR'
527 fi
528 else
529 as_ln_s='cp -pR'
530 fi
531 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
532 rmdir conf$$.dir 2>/dev/null
533
534 if mkdir -p . 2>/dev/null; then
535 as_mkdir_p='mkdir -p "$as_dir"'
536 else
537 test -d ./-p && rmdir ./-p
538 as_mkdir_p=false
539 fi
540
541 as_test_x='test -x'
542 as_executable_p=as_fn_executable_p
543
544 # Sed expression to map a string onto a valid CPP name.
545 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
546
547 # Sed expression to map a string onto a valid variable name.
548 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
549
550
551
552
553
554 SHELL=${CONFIG_SHELL-/bin/sh}
555
556 # How were we run?
557 at_cli_args="$@"
558
559
560 # Not all shells have the 'times' builtin; the subshell is needed to make
561 # sure we discard the 'times: not found' message from the shell.
562 at_times_p=false
563 (times) >/dev/null 2>&1 && at_times_p=:
564
565 # CLI Arguments to pass to the debugging scripts.
566 at_debug_args=
567 # -e sets to true
568 at_errexit_p=false
569 # Shall we be verbose? ':' means no, empty means yes.
570 at_verbose=:
571 at_quiet=
572 # Running several jobs in parallel, 0 means as many as test groups.
573 at_jobs=1
574 at_traceon=:
575 at_trace_echo=:
576 at_check_filter_trace=:
577
578 # Shall we keep the debug scripts? Must be `:' when the suite is
579 # run by a debug script, so that the script doesn't remove itself.
580 at_debug_p=false
581 # Display help message?
582 at_help_p=false
583 # Display the version message?
584 at_version_p=false
585 # List test groups?
586 at_list_p=false
587 # --clean
588 at_clean=false
589 # Test groups to run
590 at_groups=
591 # Whether to rerun failed tests.
592 at_recheck=
593 # Whether a write failure occurred
594 at_write_fail=0
595
596 # The directory we run the suite in. Default to . if no -C option.
597 at_dir=`pwd`
598 # An absolute reference to this testsuite script.
599 case $as_myself in
600 [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
601 * ) at_myself=$at_dir/$as_myself ;;
602 esac
603 # Whether -C is in effect.
604 at_change_dir=false
605
606 # Whether to enable colored test results.
607 at_color=no
608 # As many question marks as there are digits in the last test group number.
609 # Used to normalize the test group numbers so that `ls' lists them in
610 # numerical order.
611 at_format='??'
612 # Description of all the test groups.
613 at_help_all="1;version.at:17;cflow version;version;
614 2;direct.at:17;direct tree;direct;
615 3;reverse.at:17;reverse tree;reverse;
616 4;recurse.at:17;recursive calls;recurse;
617 5;attr.at:17;attribute handling;attr;
618 6;awrapper.at:17;attribute wrapper handling;awrapper;
619 7;pwrapper.at:17;parameter wrapper handling;pwrapper;
620 8;knr.at:17;K&R style function declarations;knr;
621 9;fdecl.at:17;forward function declarations;fdecl;
622 10;static.at:17;Static symbols with forward decls and -i^s;static fdecl;
623 11;include.at:17;included symbols;include;
624 12;ssblock.at:17;static struct in block scope;ssblock;
625 13;funcarg.at:17;functional arguments;funcarg;
626 14;parm.at:17;function parameter handling;parm param;
627 15;nfparg.at:19;nameless function pointer arguments;nfp nfparg function pointer arguments;
628 16;nfarg.at:24;nameless function arguments;nfarg function arguments;
629 17;hiding.at:17;hiding of global and file static identifiers;hiding;
630 18;multi.at:17;multiple source files;multi;
631 19;bartest.at:20;vertical bar in tree output;tree bartest;
632 20;decl01.at:17;same type declaration;decl decl01;
633 21;invalid.at:17;invalid input;invalid;
634 22;memberof.at:17;member of;memberof;
635 23;num.at:17;numeric constants;num;
636 24;struct.at:19;struct definition followed by attribute;struct struct-attr attribute;
637 25;struct.at:33;struct definition followed by wrapper;struct struct01 struct-wrapper wrapper;
638 26;struct.at:49;ANSI C function returning a struct;struct struct02 ret-struct;
639 27;struct.at:67;K&R C function returning a struct;struct struct03 ret-struct;
640 28;struct.at:88;struct as argument;struct struct04 arg-struct;
641 29;struct.at:100;struct variable;struct struct05 var-struct;
642 30;struct.at:109;array of structs;struct struct06 arr-struct;
643 31;struct.at:122;union in typedefs;struct struct07 union typedef;
644 32;typedef.at:19;structs with same members;typedef typedef00;
645 33;typedef.at:19;structs with tags matching typedef;typedef typedef01;
646 34;typedef.at:19;typedef to pointer;typedef typedef02;
647 35;typedef.at:19;modifiers;typedef typedef03;
648 36;all.at:20;default;all all-default all00;
649 37;all.at:47;default (main present);all all-default-main all01;
650 38;all.at:76;the --main option;all all--main all02;
651 39;all.at:102;the --all option;all all--all all03;
652 40;all.at:131;the --all --all option;all all--all--all all04;
653 41;all.at:162;the --all option with main;all all--all-main all05;
654 42;all.at:198;the --all --all option with main;all all--all--all-main all06;
655 43;all.at:236;the --no-main option;all all--no-main all07;
656 44;all.at:266;the --no-main option with main;all all--no-main-main all08;
657 45;corner.at:19;empty expression and closing brace;corner corner1;
658 46;corner.at:28;duplicate typedef;corner corner2;
659 "
660 # List of the all the test groups.
661 at_groups_all=`printf "%s\n" "$at_help_all" | sed 's/;.*//'`
662
663 # at_fn_validate_ranges NAME...
664 # -----------------------------
665 # Validate and normalize the test group number contained in each variable
666 # NAME. Leading zeroes are treated as decimal.
667 at_fn_validate_ranges ()
668 {
669 for at_grp
670 do
671 eval at_value=\$$at_grp
672 if test $at_value -lt 1 || test $at_value -gt 46; then
673 printf "%s\n" "invalid test group: $at_value" >&2
674 exit 1
675 fi
676 case $at_value in
677 0*) # We want to treat leading 0 as decimal, like expr and test, but
678 # AS_VAR_ARITH treats it as octal if it uses $(( )).
679 # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
680 # expr fork, but it is not worth the effort to determine if the
681 # shell supports XSI when the user can just avoid leading 0.
682 eval $at_grp='`expr $at_value + 0`' ;;
683 esac
684 done
685 }
686 # List of the tested programs.
687 at_tested='"cflow"'
688
689
690 at_prev=
691 for at_option
692 do
693 # If the previous option needs an argument, assign it.
694 if test -n "$at_prev"; then
695 at_option=$at_prev=$at_option
696 at_prev=
697 fi
698
699 case $at_option in
700 *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
701 *) at_optarg= ;;
702 esac
703
704 case $at_option in
705 --help | -h )
706 at_help_p=:
707 ;;
708
709 --list | -l )
710 at_list_p=:
711 ;;
712
713 --version | -V )
714 at_version_p=:
715 ;;
716
717 --clean | -c )
718 at_clean=:
719 ;;
720
721 --color )
722 at_color=always
723 ;;
724 --color=* )
725 case $at_optarg in
726 no | never | none) at_color=never ;;
727 auto | tty | if-tty) at_color=auto ;;
728 always | yes | force) at_color=always ;;
729 *) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
730 as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
731 esac
732 ;;
733
734 --debug | -d )
735 at_debug_p=:
736 ;;
737
738 --errexit | -e )
739 at_debug_p=:
740 at_errexit_p=:
741 ;;
742
743 --verbose | -v )
744 at_verbose=; at_quiet=:
745 ;;
746
747 --trace | -x )
748 at_traceon='set -x'
749 at_trace_echo=echo
750 at_check_filter_trace=at_fn_filter_trace
751 ;;
752
753 [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
754 at_fn_validate_ranges at_option
755 as_fn_append at_groups "$at_option$as_nl"
756 ;;
757
758 # Ranges
759 [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
760 at_range_start=`echo $at_option |tr -d X-`
761 at_fn_validate_ranges at_range_start
762 at_range=`printf "%s\n" "$at_groups_all" | \
763 sed -ne '/^'$at_range_start'$/,$p'`
764 as_fn_append at_groups "$at_range$as_nl"
765 ;;
766
767 -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
768 at_range_end=`echo $at_option |tr -d X-`
769 at_fn_validate_ranges at_range_end
770 at_range=`printf "%s\n" "$at_groups_all" | \
771 sed -ne '1,/^'$at_range_end'$/p'`
772 as_fn_append at_groups "$at_range$as_nl"
773 ;;
774
775 [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
776 [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
777 [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
778 [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
779 [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
780 [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
781 at_range_start=`expr $at_option : '\(.*\)-'`
782 at_range_end=`expr $at_option : '.*-\(.*\)'`
783 if test $at_range_start -gt $at_range_end; then
784 at_tmp=$at_range_end
785 at_range_end=$at_range_start
786 at_range_start=$at_tmp
787 fi
788 at_fn_validate_ranges at_range_start at_range_end
789 at_range=`printf "%s\n" "$at_groups_all" | \
790 sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
791 as_fn_append at_groups "$at_range$as_nl"
792 ;;
793
794 # Directory selection.
795 --directory | -C )
796 at_prev=--directory
797 ;;
798 --directory=* )
799 at_change_dir=:
800 at_dir=$at_optarg
801 if test x- = "x$at_dir" ; then
802 at_dir=./-
803 fi
804 ;;
805
806 # Parallel execution.
807 --jobs | -j )
808 at_jobs=0
809 ;;
810 --jobs=* | -j[0-9]* )
811 if test -n "$at_optarg"; then
812 at_jobs=$at_optarg
813 else
814 at_jobs=`expr X$at_option : 'X-j\(.*\)'`
815 fi
816 case $at_jobs in *[!0-9]*)
817 at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
818 as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
819 esac
820 ;;
821
822 # Keywords.
823 --keywords | -k )
824 at_prev=--keywords
825 ;;
826 --keywords=* )
827 at_groups_selected=$at_help_all
828 at_save_IFS=$IFS
829 IFS=,
830 set X $at_optarg
831 shift
832 IFS=$at_save_IFS
833 for at_keyword
834 do
835 at_invert=
836 case $at_keyword in
837 '!'*)
838 at_invert="-v"
839 at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
840 ;;
841 esac
842 # It is on purpose that we match the test group titles too.
843 at_groups_selected=`printf "%s\n" "$at_groups_selected" |
844 grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
845 done
846 # Smash the keywords.
847 at_groups_selected=`printf "%s\n" "$at_groups_selected" | sed 's/;.*//'`
848 as_fn_append at_groups "$at_groups_selected$as_nl"
849 ;;
850 --recheck)
851 at_recheck=:
852 ;;
853
854 *=*)
855 at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
856 # Reject names that are not valid shell variable names.
857 case $at_envvar in
858 '' | [0-9]* | *[!_$as_cr_alnum]* )
859 as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
860 esac
861 at_value=`printf "%s\n" "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
862 # Export now, but save eval for later and for debug scripts.
863 export $at_envvar
864 as_fn_append at_debug_args " $at_envvar='$at_value'"
865 ;;
866
867 *) printf "%s\n" "$as_me: invalid option: $at_option" >&2
868 printf "%s\n" "Try \`$0 --help' for more information." >&2
869 exit 1
870 ;;
871 esac
872 done
873
874 # Verify our last option didn't require an argument
875 if test -n "$at_prev"
876 then :
877 as_fn_error $? "\`$at_prev' requires an argument"
878 fi
879
880 # The file containing the suite.
881 at_suite_log=$at_dir/$as_me.log
882
883 # Selected test groups.
884 if test -z "$at_groups$at_recheck"; then
885 at_groups=$at_groups_all
886 else
887 if test -n "$at_recheck" && test -r "$at_suite_log"; then
888 at_oldfails=`sed -n '
889 /^Failed tests:$/,/^Skipped tests:$/{
890 s/^[ ]*\([1-9][0-9]*\):.*/\1/p
891 }
892 /^Unexpected passes:$/,/^## Detailed failed tests/{
893 s/^[ ]*\([1-9][0-9]*\):.*/\1/p
894 }
895 /^## Detailed failed tests/q
896 ' "$at_suite_log"`
897 as_fn_append at_groups "$at_oldfails$as_nl"
898 fi
899 # Sort the tests, removing duplicates.
900 at_groups=`printf "%s\n" "$at_groups" | sort -nu | sed '/^$/d'`
901 fi
902
903 if test x"$at_color" = xalways \
904 || { test x"$at_color" = xauto && test -t 1; }; then
905 at_red=`printf '\033[0;31m'`
906 at_grn=`printf '\033[0;32m'`
907 at_lgn=`printf '\033[1;32m'`
908 at_blu=`printf '\033[1;34m'`
909 at_std=`printf '\033[m'`
910 else
911 at_red= at_grn= at_lgn= at_blu= at_std=
912 fi
913
914 # Help message.
915 if $at_help_p; then
916 cat <<_ATEOF || at_write_fail=1
917 Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
918
919 Run all the tests, or the selected TESTS, given by numeric ranges, and
920 save a detailed log file. Upon failure, create debugging scripts.
921
922 Do not change environment variables directly. Instead, set them via
923 command line arguments. Set \`AUTOTEST_PATH' to select the executables
924 to exercise. Each relative directory is expanded as build and source
925 directories relative to the top level of this distribution.
926 E.g., from within the build directory /tmp/foo-1.0, invoking this:
927
928 $ $0 AUTOTEST_PATH=bin
929
930 is equivalent to the following, assuming the source directory is /src/foo-1.0:
931
932 PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
933 _ATEOF
934 cat <<_ATEOF || at_write_fail=1
935
936 Operation modes:
937 -h, --help print the help message, then exit
938 -V, --version print version number, then exit
939 -c, --clean remove all the files this test suite might create and exit
940 -l, --list describes all the tests, or the selected TESTS
941 _ATEOF
942 cat <<_ATEOF || at_write_fail=1
943
944 Execution tuning:
945 -C, --directory=DIR
946 change to directory DIR before starting
947 --color[=never|auto|always]
948 enable colored test results on terminal, or always
949 -j, --jobs[=N]
950 Allow N jobs at once; infinite jobs with no arg (default 1)
951 -k, --keywords=KEYWORDS
952 select the tests matching all the comma-separated KEYWORDS
953 multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
954 --recheck select all tests that failed or passed unexpectedly last time
955 -e, --errexit abort as soon as a test fails; implies --debug
956 -v, --verbose force more detailed output
957 default for debugging scripts
958 -d, --debug inhibit clean up and top-level logging
959 default for debugging scripts
960 -x, --trace enable tests shell tracing
961 _ATEOF
962 cat <<_ATEOF || at_write_fail=1
963
964 Report bugs to <[email protected]>.
965 General help using GNU software: <https://www.gnu.org/gethelp/>.
966 _ATEOF
967 exit $at_write_fail
968 fi
969
970 # List of tests.
971 if $at_list_p; then
972 cat <<_ATEOF || at_write_fail=1
973 GNU cflow 1.8 test suite test groups:
974
975 NUM: FILE-NAME:LINE TEST-GROUP-NAME
976 KEYWORDS
977
978 _ATEOF
979 # Pass an empty line as separator between selected groups and help.
980 printf "%s\n" "$at_groups$as_nl$as_nl$at_help_all" |
981 awk 'NF == 1 && FS != ";" {
982 selected[$ 1] = 1
983 next
984 }
985 /^$/ { FS = ";" }
986 NF > 0 {
987 if (selected[$ 1]) {
988 printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
989 if ($ 4) {
990 lmax = 79
991 indent = " "
992 line = indent
993 len = length (line)
994 n = split ($ 4, a, " ")
995 for (i = 1; i <= n; i++) {
996 l = length (a[i]) + 1
997 if (i > 1 && len + l > lmax) {
998 print line
999 line = indent " " a[i]
1000 len = length (line)
1001 } else {
1002 line = line " " a[i]
1003 len += l
1004 }
1005 }
1006 if (n)
1007 print line
1008 }
1009 }
1010 }' || at_write_fail=1
1011 exit $at_write_fail
1012 fi
1013 if $at_version_p; then
1014 printf "%s\n" "$as_me (GNU cflow 1.8)" &&
1015 cat <<\_ATEOF || at_write_fail=1
1016
1017 Copyright (C) 2021 Free Software Foundation, Inc.
1018 This test suite is free software; the Free Software Foundation gives
1019 unlimited permission to copy, distribute and modify it.
1020 _ATEOF
1021 exit $at_write_fail
1022 fi
1023
1024 # Should we print banners? Yes if more than one test is run.
1025 case $at_groups in #(
1026 *$as_nl* )
1027 at_print_banners=: ;; #(
1028 * ) at_print_banners=false ;;
1029 esac
1030 # Text for banner N, set to a single space once printed.
1031 # Banner 1. struct.at:17
1032 # Category starts at test group 24.
1033 at_banner_text_1="struct"
1034 # Banner 2. typedef.at:17
1035 # Category starts at test group 32.
1036 at_banner_text_2="typedefs"
1037 # Banner 3. all.at:17
1038 # Category starts at test group 36.
1039 at_banner_text_3="all-functions mode"
1040 # Banner 4. corner.at:17
1041 # Category starts at test group 45.
1042 at_banner_text_4="special cases"
1043
1044 # Take any -C into account.
1045 if $at_change_dir ; then
1046 test x != "x$at_dir" && cd "$at_dir" \
1047 || as_fn_error $? "unable to change directory"
1048 at_dir=`pwd`
1049 fi
1050
1051 # Load the config files for any default variable assignments.
1052 for at_file in atconfig atlocal
1053 do
1054 test -r $at_file || continue
1055 . ./$at_file || as_fn_error $? "invalid content: $at_file"
1056 done
1057
1058 # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
1059 : "${at_top_build_prefix=$at_top_builddir}"
1060
1061 # Perform any assignments requested during argument parsing.
1062 eval "$at_debug_args"
1063
1064 # atconfig delivers names relative to the directory the test suite is
1065 # in, but the groups themselves are run in testsuite-dir/group-dir.
1066 if test -n "$at_top_srcdir"; then
1067 builddir=../..
1068 for at_dir_var in srcdir top_srcdir top_build_prefix
1069 do
1070 eval at_val=\$at_$at_dir_var
1071 case $at_val in
1072 [\\/$]* | ?:[\\/]* ) at_prefix= ;;
1073 *) at_prefix=../../ ;;
1074 esac
1075 eval "$at_dir_var=\$at_prefix\$at_val"
1076 done
1077 fi
1078
1079 ## -------------------- ##
1080 ## Directory structure. ##
1081 ## -------------------- ##
1082
1083 # This is the set of directories and files used by this script
1084 # (non-literals are capitalized):
1085 #
1086 # TESTSUITE - the testsuite
1087 # TESTSUITE.log - summarizes the complete testsuite run
1088 # TESTSUITE.dir/ - created during a run, remains after -d or failed test
1089 # + at-groups/ - during a run: status of all groups in run
1090 # | + NNN/ - during a run: meta-data about test group NNN
1091 # | | + check-line - location (source file and line) of current AT_CHECK
1092 # | | + status - exit status of current AT_CHECK
1093 # | | + stdout - stdout of current AT_CHECK
1094 # | | + stder1 - stderr, including trace
1095 # | | + stderr - stderr, with trace filtered out
1096 # | | + test-source - portion of testsuite that defines group
1097 # | | + times - timestamps for computing duration
1098 # | | + pass - created if group passed
1099 # | | + xpass - created if group xpassed
1100 # | | + fail - created if group failed
1101 # | | + xfail - created if group xfailed
1102 # | | + skip - created if group skipped
1103 # + at-stop - during a run: end the run if this file exists
1104 # + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
1105 # + 0..NNN/ - created for each group NNN, remains after -d or failed test
1106 # | + TESTSUITE.log - summarizes the group results
1107 # | + ... - files created during the group
1108
1109 # The directory the whole suite works in.
1110 # Should be absolute to let the user `cd' at will.
1111 at_suite_dir=$at_dir/$as_me.dir
1112 # The file containing the suite ($at_dir might have changed since earlier).
1113 at_suite_log=$at_dir/$as_me.log
1114 # The directory containing helper files per test group.
1115 at_helper_dir=$at_suite_dir/at-groups
1116 # Stop file: if it exists, do not start new jobs.
1117 at_stop_file=$at_suite_dir/at-stop
1118 # The fifo used for the job dispatcher.
1119 at_job_fifo=$at_suite_dir/at-job-fifo
1120
1121 if $at_clean; then
1122 test -d "$at_suite_dir" &&
1123 find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1124 rm -f -r "$at_suite_dir" "$at_suite_log"
1125 exit $?
1126 fi
1127
1128 # Don't take risks: use only absolute directories in PATH.
1129 #
1130 # For stand-alone test suites (ie. atconfig was not found),
1131 # AUTOTEST_PATH is relative to `.'.
1132 #
1133 # For embedded test suites, AUTOTEST_PATH is relative to the top level
1134 # of the package. Then expand it into build/src parts, since users
1135 # may create executables in both places.
1136 AUTOTEST_PATH=`printf "%s\n" "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
1137 at_path=
1138 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1139 for as_dir in $AUTOTEST_PATH $PATH
1140 do
1141 IFS=$as_save_IFS
1142 case $as_dir in #(((
1143 '') as_dir=./ ;;
1144 */) ;;
1145 *) as_dir=$as_dir/ ;;
1146 esac
1147 test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
1148 case $as_dir in
1149 [\\/]* | ?:[\\/]* )
1150 as_fn_append at_path "$as_dir"
1151 ;;
1152 * )
1153 if test -z "$at_top_build_prefix"; then
1154 # Stand-alone test suite.
1155 as_fn_append at_path "$as_dir"
1156 else
1157 # Embedded test suite.
1158 as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
1159 as_fn_append at_path "$at_top_srcdir/$as_dir"
1160 fi
1161 ;;
1162 esac
1163 done
1164 IFS=$as_save_IFS
1165
1166
1167 # Now build and simplify PATH.
1168 #
1169 # There might be directories that don't exist, but don't redirect
1170 # builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
1171 at_new_path=
1172 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1173 for as_dir in $at_path
1174 do
1175 IFS=$as_save_IFS
1176 case $as_dir in #(((
1177 '') as_dir=./ ;;
1178 */) ;;
1179 *) as_dir=$as_dir/ ;;
1180 esac
1181 test -d "$as_dir" || continue
1182 case $as_dir in
1183 [\\/]* | ?:[\\/]* ) ;;
1184 * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
1185 esac
1186 case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
1187 *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
1188 $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
1189 *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
1190 esac
1191 done
1192 IFS=$as_save_IFS
1193
1194 PATH=$at_new_path
1195 export PATH
1196
1197 # Setting up the FDs.
1198
1199
1200
1201 # 5 is the log file. Not to be overwritten if `-d'.
1202 if $at_debug_p; then
1203 at_suite_log=/dev/null
1204 else
1205 : >"$at_suite_log"
1206 fi
1207 exec 5>>"$at_suite_log"
1208
1209 # Banners and logs.
1210 printf "%s\n" "## ------------------------- ##
1211 ## GNU cflow 1.8 test suite. ##
1212 ## ------------------------- ##"
1213 {
1214 printf "%s\n" "## ------------------------- ##
1215 ## GNU cflow 1.8 test suite. ##
1216 ## ------------------------- ##"
1217 echo
1218
1219 printf "%s\n" "$as_me: command line was:"
1220 printf "%s\n" " \$ $0 $at_cli_args"
1221 echo
1222
1223 # If ChangeLog exists, list a few lines in case it might help determining
1224 # the exact version.
1225 if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
1226 printf "%s\n" "## ---------- ##
1227 ## ChangeLog. ##
1228 ## ---------- ##"
1229 echo
1230 sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
1231 echo
1232 fi
1233
1234 {
1235 cat <<_ASUNAME
1236 ## --------- ##
1237 ## Platform. ##
1238 ## --------- ##
1239
1240 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1241 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1242 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1243 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1244 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1245
1246 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1247 /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
1248
1249 /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
1250 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
1251 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1252 /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
1253 /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
1254 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
1255 /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
1256
1257 _ASUNAME
1258
1259 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1260 for as_dir in $PATH
1261 do
1262 IFS=$as_save_IFS
1263 case $as_dir in #(((
1264 '') as_dir=./ ;;
1265 */) ;;
1266 *) as_dir=$as_dir/ ;;
1267 esac
1268 printf "%s\n" "PATH: $as_dir"
1269 done
1270 IFS=$as_save_IFS
1271
1272 }
1273 echo
1274
1275 # Contents of the config files.
1276 for at_file in atconfig atlocal
1277 do
1278 test -r $at_file || continue
1279 printf "%s\n" "$as_me: $at_file:"
1280 sed 's/^/| /' $at_file
1281 echo
1282 done
1283 } >&5
1284
1285
1286 ## ------------------------- ##
1287 ## Autotest shell functions. ##
1288 ## ------------------------- ##
1289
1290 # at_fn_banner NUMBER
1291 # -------------------
1292 # Output banner NUMBER, provided the testsuite is running multiple groups and
1293 # this particular banner has not yet been printed.
1294 at_fn_banner ()
1295 {
1296 $at_print_banners || return 0
1297 eval at_banner_text=\$at_banner_text_$1
1298 test "x$at_banner_text" = "x " && return 0
1299 eval "at_banner_text_$1=\" \""
1300 if test -z "$at_banner_text"; then
1301 $at_first || echo
1302 else
1303 printf "%s\n" "$as_nl$at_banner_text$as_nl"
1304 fi
1305 } # at_fn_banner
1306
1307 # at_fn_check_prepare_notrace REASON LINE
1308 # ---------------------------------------
1309 # Perform AT_CHECK preparations for the command at LINE for an untraceable
1310 # command; REASON is the reason for disabling tracing.
1311 at_fn_check_prepare_notrace ()
1312 {
1313 $at_trace_echo "Not enabling shell tracing (command contains $1)"
1314 printf "%s\n" "$2" >"$at_check_line_file"
1315 at_check_trace=: at_check_filter=:
1316 : >"$at_stdout"; : >"$at_stderr"
1317 }
1318
1319 # at_fn_check_prepare_trace LINE
1320 # ------------------------------
1321 # Perform AT_CHECK preparations for the command at LINE for a traceable
1322 # command.
1323 at_fn_check_prepare_trace ()
1324 {
1325 printf "%s\n" "$1" >"$at_check_line_file"
1326 at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
1327 : >"$at_stdout"; : >"$at_stderr"
1328 }
1329
1330 # at_fn_check_prepare_dynamic COMMAND LINE
1331 # ----------------------------------------
1332 # Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
1333 # preparation function.
1334 at_fn_check_prepare_dynamic ()
1335 {
1336 case $1 in
1337 *$as_nl*)
1338 at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
1339 *)
1340 at_fn_check_prepare_trace "$2" ;;
1341 esac
1342 }
1343
1344 # at_fn_filter_trace
1345 # ------------------
1346 # Remove the lines in the file "$at_stderr" generated by "set -x" and print
1347 # them to stderr.
1348 at_fn_filter_trace ()
1349 {
1350 mv "$at_stderr" "$at_stder1"
1351 grep '^ *+' "$at_stder1" >&2
1352 grep -v '^ *+' "$at_stder1" >"$at_stderr"
1353 }
1354
1355 # at_fn_log_failure FILE-LIST
1356 # ---------------------------
1357 # Copy the files in the list on stdout with a "> " prefix, and exit the shell
1358 # with a failure exit code.
1359 at_fn_log_failure ()
1360 {
1361 for file
1362 do printf "%s\n" "$file:"; sed 's/^/> /' "$file"; done
1363 echo 1 > "$at_status_file"
1364 exit 1
1365 }
1366
1367 # at_fn_check_skip EXIT-CODE LINE
1368 # -------------------------------
1369 # Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
1370 # the test group subshell with that same exit code. Use LINE in any report
1371 # about test failure.
1372 at_fn_check_skip ()
1373 {
1374 case $1 in
1375 99) echo 99 > "$at_status_file"; at_failed=:
1376 printf "%s\n" "$2: hard failure"; exit 99;;
1377 77) echo 77 > "$at_status_file"; exit 77;;
1378 esac
1379 }
1380
1381 # at_fn_check_status EXPECTED EXIT-CODE LINE
1382 # ------------------------------------------
1383 # Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
1384 # Otherwise, if it is 77 or 99, exit the test group subshell with that same
1385 # exit code; if it is anything else print an error message referring to LINE,
1386 # and fail the test.
1387 at_fn_check_status ()
1388 {
1389 case $2 in
1390 $1 ) ;;
1391 77) echo 77 > "$at_status_file"; exit 77;;
1392 99) echo 99 > "$at_status_file"; at_failed=:
1393 printf "%s\n" "$3: hard failure"; exit 99;;
1394 *) printf "%s\n" "$3: exit code was $2, expected $1"
1395 at_failed=:;;
1396 esac
1397 }
1398
1399 # at_fn_diff_devnull FILE
1400 # -----------------------
1401 # Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
1402 # invocations.
1403 at_fn_diff_devnull ()
1404 {
1405 test -s "$1" || return 0
1406 $at_diff "$at_devnull" "$1"
1407 }
1408
1409 # at_fn_test NUMBER
1410 # -----------------
1411 # Parse out test NUMBER from the tail of this file.
1412 at_fn_test ()
1413 {
1414 eval at_sed=\$at_sed$1
1415 sed "$at_sed" "$at_myself" > "$at_test_source"
1416 }
1417
1418 # at_fn_create_debugging_script
1419 # -----------------------------
1420 # Create the debugging script $at_group_dir/run which will reproduce the
1421 # current test group.
1422 at_fn_create_debugging_script ()
1423 {
1424 {
1425 echo "#! /bin/sh" &&
1426 echo 'test ${ZSH_VERSION+y} && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
1427 printf "%s\n" "cd '$at_dir'" &&
1428 printf "%s\n" "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
1429 echo 'exit 1'
1430 } >"$at_group_dir/run" &&
1431 chmod +x "$at_group_dir/run"
1432 }
1433
1434 ## -------------------------------- ##
1435 ## End of autotest shell functions. ##
1436 ## -------------------------------- ##
1437 {
1438 printf "%s\n" "## ---------------- ##
1439 ## Tested programs. ##
1440 ## ---------------- ##"
1441 echo
1442 } >&5
1443
1444 # Report what programs are being tested.
1445 for at_program in : `eval echo $at_tested`
1446 do
1447 case $at_program in #(
1448 :) :
1449 continue ;; #(
1450 [\\/]* | ?:[\\/]*) :
1451 at_program_=$at_program ;; #(
1452 *) :
1453 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1454 for as_dir in $PATH
1455 do
1456 IFS=$as_save_IFS
1457 case $as_dir in #(((
1458 '') as_dir=./ ;;
1459 */) ;;
1460 *) as_dir=$as_dir/ ;;
1461 esac
1462 test -f "$as_dir$at_program" && break
1463 done
1464 IFS=$as_save_IFS
1465
1466 at_program_=$as_dir$at_program ;;
1467 esac
1468
1469 if test -f "$at_program_"; then
1470 {
1471 printf "%s\n" "$at_srcdir/testsuite.at:50: $at_program_ --version"
1472 "$at_program_" --version </dev/null
1473 echo
1474 } >&5 2>&1
1475 else
1476 as_fn_error $? "cannot find $at_program" "$LINENO" 5
1477 fi
1478 done
1479
1480 {
1481 printf "%s\n" "## ------------------ ##
1482 ## Running the tests. ##
1483 ## ------------------ ##"
1484 } >&5
1485
1486 at_start_date=`date`
1487 at_start_time=`date +%s 2>/dev/null`
1488 printf "%s\n" "$as_me: starting at: $at_start_date" >&5
1489
1490 # Create the master directory if it doesn't already exist.
1491 as_dir="$at_suite_dir"; as_fn_mkdir_p ||
1492 as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
1493
1494 # Can we diff with `/dev/null'? DU 5.0 refuses.
1495 if diff /dev/null /dev/null >/dev/null 2>&1; then
1496 at_devnull=/dev/null
1497 else
1498 at_devnull=$at_suite_dir/devnull
1499 >"$at_devnull"
1500 fi
1501
1502 # Use `diff -u' when possible.
1503 if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
1504 then
1505 at_diff='diff -u'
1506 else
1507 at_diff=diff
1508 fi
1509
1510 # Get the last needed group.
1511 for at_group in : $at_groups; do :; done
1512
1513 # Extract the start and end lines of each test group at the tail
1514 # of this file
1515 awk '
1516 BEGIN { FS="" }
1517 /^#AT_START_/ {
1518 start = NR
1519 }
1520 /^#AT_STOP_/ {
1521 test = substr ($ 0, 10)
1522 print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
1523 if (test == "'"$at_group"'") exit
1524 }' "$at_myself" > "$at_suite_dir/at-source-lines" &&
1525 . "$at_suite_dir/at-source-lines" ||
1526 as_fn_error $? "cannot create test line number cache" "$LINENO" 5
1527 rm -f "$at_suite_dir/at-source-lines"
1528
1529 # Set number of jobs for `-j'; avoid more jobs than test groups.
1530 set X $at_groups; shift; at_max_jobs=$#
1531 if test $at_max_jobs -eq 0; then
1532 at_jobs=1
1533 fi
1534 if test $at_jobs -ne 1 &&
1535 { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
1536 at_jobs=$at_max_jobs
1537 fi
1538
1539 # If parallel mode, don't output banners, don't split summary lines.
1540 if test $at_jobs -ne 1; then
1541 at_print_banners=false
1542 at_quiet=:
1543 fi
1544
1545 # Set up helper dirs.
1546 rm -rf "$at_helper_dir" &&
1547 mkdir "$at_helper_dir" &&
1548 cd "$at_helper_dir" &&
1549 { test -z "$at_groups" || mkdir $at_groups; } ||
1550 as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
1551
1552 # Functions for running a test group. We leave the actual
1553 # test group execution outside of a shell function in order
1554 # to avoid hitting zsh 4.x exit status bugs.
1555
1556 # at_fn_group_prepare
1557 # -------------------
1558 # Prepare for running a test group.
1559 at_fn_group_prepare ()
1560 {
1561 # The directory for additional per-group helper files.
1562 at_job_dir=$at_helper_dir/$at_group
1563 # The file containing the location of the last AT_CHECK.
1564 at_check_line_file=$at_job_dir/check-line
1565 # The file containing the exit status of the last command.
1566 at_status_file=$at_job_dir/status
1567 # The files containing the output of the tested commands.
1568 at_stdout=$at_job_dir/stdout
1569 at_stder1=$at_job_dir/stder1
1570 at_stderr=$at_job_dir/stderr
1571 # The file containing the code for a test group.
1572 at_test_source=$at_job_dir/test-source
1573 # The file containing dates.
1574 at_times_file=$at_job_dir/times
1575
1576 # Be sure to come back to the top test directory.
1577 cd "$at_suite_dir"
1578
1579 # Clearly separate the test groups when verbose.
1580 $at_first || $at_verbose echo
1581
1582 at_group_normalized=$at_group
1583
1584 eval 'while :; do
1585 case $at_group_normalized in #(
1586 '"$at_format"'*) break;;
1587 esac
1588 at_group_normalized=0$at_group_normalized
1589 done'
1590
1591
1592 # Create a fresh directory for the next test group, and enter.
1593 # If one already exists, the user may have invoked ./run from
1594 # within that directory; we remove the contents, but not the
1595 # directory itself, so that we aren't pulling the rug out from
1596 # under the shell's notion of the current directory.
1597 at_group_dir=$at_suite_dir/$at_group_normalized
1598 at_group_log=$at_group_dir/$as_me.log
1599 if test -d "$at_group_dir"
1600 then
1601 find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
1602 rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
1603 fi ||
1604 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
1605 printf "%s\n" "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
1606 # Be tolerant if the above `rm' was not able to remove the directory.
1607 as_dir="$at_group_dir"; as_fn_mkdir_p
1608
1609 echo 0 > "$at_status_file"
1610
1611 # In verbose mode, append to the log file *and* show on
1612 # the standard output; in quiet mode only write to the log.
1613 if test -z "$at_verbose"; then
1614 at_tee_pipe='tee -a "$at_group_log"'
1615 else
1616 at_tee_pipe='cat >> "$at_group_log"'
1617 fi
1618 }
1619
1620 # at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
1621 # -------------------------------------------------
1622 # Declare the test group ORDINAL, located at LINE with group description DESC,
1623 # and residing under BANNER. Use PAD to align the status column.
1624 at_fn_group_banner ()
1625 {
1626 at_setup_line="$2"
1627 test -n "$5" && at_fn_banner $5
1628 at_desc="$3"
1629 case $1 in
1630 [0-9]) at_desc_line=" $1: ";;
1631 [0-9][0-9]) at_desc_line=" $1: " ;;
1632 *) at_desc_line="$1: " ;;
1633 esac
1634 as_fn_append at_desc_line "$3$4"
1635 $at_quiet printf %s "$at_desc_line"
1636 echo "# -*- compilation -*-" >> "$at_group_log"
1637 }
1638
1639 # at_fn_group_postprocess
1640 # -----------------------
1641 # Perform cleanup after running a test group.
1642 at_fn_group_postprocess ()
1643 {
1644 # Be sure to come back to the suite directory, in particular
1645 # since below we might `rm' the group directory we are in currently.
1646 cd "$at_suite_dir"
1647
1648 if test ! -f "$at_check_line_file"; then
1649 sed "s/^ */$as_me: WARNING: /" <<_ATEOF
1650 A failure happened in a test group before any test could be
1651 run. This means that test suite is improperly designed. Please
1652 report this failure to <[email protected]>.
1653 _ATEOF
1654 printf "%s\n" "$at_setup_line" >"$at_check_line_file"
1655 at_status=99
1656 fi
1657 $at_verbose printf %s "$at_group. $at_setup_line: "
1658 printf %s "$at_group. $at_setup_line: " >> "$at_group_log"
1659 case $at_xfail:$at_status in
1660 yes:0)
1661 at_msg="UNEXPECTED PASS"
1662 at_res=xpass
1663 at_errexit=$at_errexit_p
1664 at_color=$at_red
1665 ;;
1666 no:0)
1667 at_msg="ok"
1668 at_res=pass
1669 at_errexit=false
1670 at_color=$at_grn
1671 ;;
1672 *:77)
1673 at_msg='skipped ('`cat "$at_check_line_file"`')'
1674 at_res=skip
1675 at_errexit=false
1676 at_color=$at_blu
1677 ;;
1678 no:* | *:99)
1679 at_msg='FAILED ('`cat "$at_check_line_file"`')'
1680 at_res=fail
1681 at_errexit=$at_errexit_p
1682 at_color=$at_red
1683 ;;
1684 yes:*)
1685 at_msg='expected failure ('`cat "$at_check_line_file"`')'
1686 at_res=xfail
1687 at_errexit=false
1688 at_color=$at_lgn
1689 ;;
1690 esac
1691 echo "$at_res" > "$at_job_dir/$at_res"
1692 # In parallel mode, output the summary line only afterwards.
1693 if test $at_jobs -ne 1 && test -n "$at_verbose"; then
1694 printf "%s\n" "$at_desc_line $at_color$at_msg$at_std"
1695 else
1696 # Make sure there is a separator even with long titles.
1697 printf "%s\n" " $at_color$at_msg$at_std"
1698 fi
1699 at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
1700 case $at_status in
1701 0|77)
1702 # $at_times_file is only available if the group succeeded.
1703 # We're not including the group log, so the success message
1704 # is written in the global log separately. But we also
1705 # write to the group log in case they're using -d.
1706 if test -f "$at_times_file"; then
1707 at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')'
1708 rm -f "$at_times_file"
1709 fi
1710 printf "%s\n" "$at_log_msg" >> "$at_group_log"
1711 printf "%s\n" "$at_log_msg" >&5
1712
1713 # Cleanup the group directory, unless the user wants the files
1714 # or the success was unexpected.
1715 if $at_debug_p || test $at_res = xpass; then
1716 at_fn_create_debugging_script
1717 if test $at_res = xpass && $at_errexit; then
1718 echo stop > "$at_stop_file"
1719 fi
1720 else
1721 if test -d "$at_group_dir"; then
1722 find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
1723 rm -fr "$at_group_dir"
1724 fi
1725 rm -f "$at_test_source"
1726 fi
1727 ;;
1728 *)
1729 # Upon failure, include the log into the testsuite's global
1730 # log. The failure message is written in the group log. It
1731 # is later included in the global log.
1732 printf "%s\n" "$at_log_msg" >> "$at_group_log"
1733
1734 # Upon failure, keep the group directory for autopsy, and create
1735 # the debugging script. With -e, do not start any further tests.
1736 at_fn_create_debugging_script
1737 if $at_errexit; then
1738 echo stop > "$at_stop_file"
1739 fi
1740 ;;
1741 esac
1742 }
1743
1744
1745 ## ------------ ##
1746 ## Driver loop. ##
1747 ## ------------ ##
1748
1749
1750 if (set -m && set +m && set +b) >/dev/null 2>&1; then
1751 set +b
1752 at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
1753 else
1754 at_job_control_on=: at_job_control_off=: at_job_group=
1755 fi
1756
1757 for at_signal in 1 2 15; do
1758 trap 'set +x; set +e
1759 $at_job_control_off
1760 at_signal='"$at_signal"'
1761 echo stop > "$at_stop_file"
1762 trap "" $at_signal
1763 at_pgids=
1764 for at_pgid in `jobs -p 2>/dev/null`; do
1765 at_pgids="$at_pgids $at_job_group$at_pgid"
1766 done
1767 test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
1768 wait
1769 if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
1770 echo >&2
1771 fi
1772 at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
1773 set x $at_signame
1774 test 0 -gt 2 && at_signame=$at_signal
1775 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
1776 printf "%s\n" "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
1777 as_fn_arith 128 + $at_signal && exit_status=$as_val
1778 as_fn_exit $exit_status' $at_signal
1779 done
1780
1781 rm -f "$at_stop_file"
1782 at_first=:
1783
1784 if test $at_jobs -ne 1 &&
1785 rm -f "$at_job_fifo" &&
1786 test -n "$at_job_group" &&
1787 ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
1788 then
1789 # FIFO job dispatcher.
1790
1791 trap 'at_pids=
1792 for at_pid in `jobs -p`; do
1793 at_pids="$at_pids $at_job_group$at_pid"
1794 done
1795 if test -n "$at_pids"; then
1796 at_sig=TSTP
1797 test ${TMOUT+y} && at_sig=STOP
1798 kill -$at_sig $at_pids 2>/dev/null
1799 fi
1800 kill -STOP $$
1801 test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
1802
1803 echo
1804 # Turn jobs into a list of numbers, starting from 1.
1805 at_joblist=`printf "%s\n" "$at_groups" | sed -n 1,${at_jobs}p`
1806
1807 set X $at_joblist
1808 shift
1809 for at_group in $at_groups; do
1810 $at_job_control_on 2>/dev/null
1811 (
1812 # Start one test group.
1813 $at_job_control_off
1814 if $at_first; then
1815 exec 7>"$at_job_fifo"
1816 else
1817 exec 6<&-
1818 fi
1819 trap 'set +x; set +e
1820 trap "" PIPE
1821 echo stop > "$at_stop_file"
1822 echo >&7
1823 as_fn_exit 141' PIPE
1824 at_fn_group_prepare
1825 if cd "$at_group_dir" &&
1826 at_fn_test $at_group &&
1827 . "$at_test_source"
1828 then :; else
1829 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1830 printf "%s\n" "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1831 at_failed=:
1832 fi
1833 at_fn_group_postprocess
1834 echo >&7
1835 ) &
1836 $at_job_control_off
1837 if $at_first; then
1838 at_first=false
1839 exec 6<"$at_job_fifo" 7>"$at_job_fifo"
1840 fi
1841 shift # Consume one token.
1842 if test $# -gt 0; then :; else
1843 read at_token <&6 || break
1844 set x $*
1845 fi
1846 test -f "$at_stop_file" && break
1847 done
1848 exec 7>&-
1849 # Read back the remaining ($at_jobs - 1) tokens.
1850 set X $at_joblist
1851 shift
1852 if test $# -gt 0; then
1853 shift
1854 for at_job
1855 do
1856 read at_token
1857 done <&6
1858 fi
1859 exec 6<&-
1860 wait
1861 else
1862 # Run serially, avoid forks and other potential surprises.
1863 for at_group in $at_groups; do
1864 at_fn_group_prepare
1865 if cd "$at_group_dir" &&
1866 at_fn_test $at_group &&
1867 . "$at_test_source"; then :; else
1868 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
1869 printf "%s\n" "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
1870 at_failed=:
1871 fi
1872 at_fn_group_postprocess
1873 test -f "$at_stop_file" && break
1874 at_first=false
1875 done
1876 fi
1877
1878 # Wrap up the test suite with summary statistics.
1879 cd "$at_helper_dir"
1880
1881 # Use ?..???? when the list must remain sorted, the faster * otherwise.
1882 at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
1883 at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
1884 at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
1885 at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
1886 echo $f; done | sed '/?/d; s,/xpass,,'`
1887 at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
1888 echo $f; done | sed '/?/d; s,/fail,,'`
1889
1890 set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
1891 shift; at_group_count=$#
1892 set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
1893 set X $at_xfail_list; shift; at_xfail_count=$#
1894 set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
1895 set X $at_skip_list; shift; at_skip_count=$#
1896
1897 as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
1898 as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
1899 as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
1900
1901 # Back to the top directory.
1902 cd "$at_dir"
1903 rm -rf "$at_helper_dir"
1904
1905 # Compute the duration of the suite.
1906 at_stop_date=`date`
1907 at_stop_time=`date +%s 2>/dev/null`
1908 printf "%s\n" "$as_me: ending at: $at_stop_date" >&5
1909 case $at_start_time,$at_stop_time in
1910 [0-9]*,[0-9]*)
1911 as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
1912 as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
1913 as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
1914 as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
1915 as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
1916 at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
1917 printf "%s\n" "$as_me: test suite duration: $at_duration" >&5
1918 ;;
1919 esac
1920
1921 echo
1922 printf "%s\n" "## ------------- ##
1923 ## Test results. ##
1924 ## ------------- ##"
1925 echo
1926 {
1927 echo
1928 printf "%s\n" "## ------------- ##
1929 ## Test results. ##
1930 ## ------------- ##"
1931 echo
1932 } >&5
1933
1934 if test $at_run_count = 1; then
1935 at_result="1 test"
1936 at_were=was
1937 else
1938 at_result="$at_run_count tests"
1939 at_were=were
1940 fi
1941 if $at_errexit_p && test $at_unexpected_count != 0; then
1942 if test $at_xpass_count = 1; then
1943 at_result="$at_result $at_were run, one passed"
1944 else
1945 at_result="$at_result $at_were run, one failed"
1946 fi
1947 at_result="$at_result unexpectedly and inhibited subsequent tests."
1948 at_color=$at_red
1949 else
1950 # Don't you just love exponential explosion of the number of cases?
1951 at_color=$at_red
1952 case $at_xpass_count:$at_fail_count:$at_xfail_count in
1953 # So far, so good.
1954 0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
1955 0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
1956
1957 # Some unexpected failures
1958 0:*:0) at_result="$at_result $at_were run,
1959 $at_fail_count failed unexpectedly." ;;
1960
1961 # Some failures, both expected and unexpected
1962 0:*:1) at_result="$at_result $at_were run,
1963 $at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1964 0:*:*) at_result="$at_result $at_were run,
1965 $at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1966
1967 # No unexpected failures, but some xpasses
1968 *:0:*) at_result="$at_result $at_were run,
1969 $at_xpass_count passed unexpectedly." ;;
1970
1971 # No expected failures, but failures and xpasses
1972 *:1:0) at_result="$at_result $at_were run,
1973 $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
1974 *:*:0) at_result="$at_result $at_were run,
1975 $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
1976
1977 # All of them.
1978 *:*:1) at_result="$at_result $at_were run,
1979 $at_xpass_count passed unexpectedly,
1980 $at_total_fail_count failed ($at_xfail_count expected failure)." ;;
1981 *:*:*) at_result="$at_result $at_were run,
1982 $at_xpass_count passed unexpectedly,
1983 $at_total_fail_count failed ($at_xfail_count expected failures)." ;;
1984 esac
1985
1986 if test $at_skip_count = 0 && test $at_run_count -gt 1; then
1987 at_result="All $at_result"
1988 fi
1989 fi
1990
1991 # Now put skips in the mix.
1992 case $at_skip_count in
1993 0) ;;
1994 1) at_result="$at_result
1995 1 test was skipped." ;;
1996 *) at_result="$at_result
1997 $at_skip_count tests were skipped." ;;
1998 esac
1999
2000 if test $at_unexpected_count = 0; then
2001 echo "$at_color$at_result$at_std"
2002 echo "$at_result" >&5
2003 else
2004 echo "${at_color}ERROR: $at_result$at_std" >&2
2005 echo "ERROR: $at_result" >&5
2006 {
2007 echo
2008 printf "%s\n" "## ------------------------ ##
2009 ## Summary of the failures. ##
2010 ## ------------------------ ##"
2011
2012 # Summary of failed and skipped tests.
2013 if test $at_fail_count != 0; then
2014 echo "Failed tests:"
2015 $SHELL "$at_myself" $at_fail_list --list
2016 echo
2017 fi
2018 if test $at_skip_count != 0; then
2019 echo "Skipped tests:"
2020 $SHELL "$at_myself" $at_skip_list --list
2021 echo
2022 fi
2023 if test $at_xpass_count != 0; then
2024 echo "Unexpected passes:"
2025 $SHELL "$at_myself" $at_xpass_list --list
2026 echo
2027 fi
2028 if test $at_fail_count != 0; then
2029 printf "%s\n" "## ---------------------- ##
2030 ## Detailed failed tests. ##
2031 ## ---------------------- ##"
2032 echo
2033 for at_group in $at_fail_list
2034 do
2035 at_group_normalized=$at_group
2036
2037 eval 'while :; do
2038 case $at_group_normalized in #(
2039 '"$at_format"'*) break;;
2040 esac
2041 at_group_normalized=0$at_group_normalized
2042 done'
2043
2044 cat "$at_suite_dir/$at_group_normalized/$as_me.log"
2045 echo
2046 done
2047 echo
2048 fi
2049 if test -n "$at_top_srcdir"; then
2050 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
2051 ## ${at_top_build_prefix}config.log ##
2052 _ASBOX
2053 sed 's/^/| /' ${at_top_build_prefix}config.log
2054 echo
2055 fi
2056 } >&5
2057
2058 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
2059 ## $as_me.log was created. ##
2060 _ASBOX
2061
2062 echo
2063 if $at_debug_p; then
2064 at_msg='per-test log files'
2065 else
2066 at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
2067 fi
2068 at_msg1a=${at_xpass_list:+', '}
2069 at_msg1=$at_fail_list${at_fail_list:+" failed$at_msg1a"}
2070 at_msg2=$at_xpass_list${at_xpass_list:+" passed unexpectedly"}
2071
2072 printf "%s\n" "Please send $at_msg and all information you think might help:
2073
2074 To: <[email protected]>
2075 Subject: [GNU cflow 1.8] $as_me: $at_msg1$at_msg2
2076
2077 You may investigate any problem if you feel able to do so, in which
2078 case the test suite provides a good starting point. Its output may
2079 be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
2080 "
2081 exit 1
2082 fi
2083
2084 exit 0
2085
2086 ## ------------- ##
2087 ## Actual tests. ##
2088 ## ------------- ##
2089 #AT_START_1
2090 at_fn_group_banner 1 'version.at:17' \
2091 "cflow version" " "
2092 at_xfail=no
2093 (
2094 printf "%s\n" "1. $at_setup_line: testing $at_desc ..."
2095 $at_traceon
2096
2097
2098
2099 { set +x
2100 printf "%s\n" "$at_srcdir/version.at:20: cflow --version | sed 1q"
2101 at_fn_check_prepare_notrace 'a shell pipeline' "version.at:20"
2102 ( $at_check_trace; cflow --version | sed 1q
2103 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2104 at_status=$? at_failed=false
2105 $at_check_filter
2106 at_fn_diff_devnull "$at_stderr" || at_failed=:
2107 echo >>"$at_stdout"; printf "%s\n" "cflow (GNU cflow) 1.8
2108 " | \
2109 $at_diff - "$at_stdout" || at_failed=:
2110 at_fn_check_status 0 $at_status "$at_srcdir/version.at:20"
2111 if $at_failed
2112 then :
2113
2114 echo '=============================================================='
2115 echo 'WARNING: Not using the proper version, *all* checks dubious...'
2116 echo '=============================================================='
2117
2118 fi
2119 $at_failed && at_fn_log_failure
2120 $at_traceon; }
2121
2122
2123 set +x
2124 $at_times_p && times >"$at_times_file"
2125 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2126 read at_status <"$at_status_file"
2127 #AT_STOP_1
2128 #AT_START_2
2129 at_fn_group_banner 2 'direct.at:17' \
2130 "direct tree" " "
2131 at_xfail=no
2132 (
2133 printf "%s\n" "2. $at_setup_line: testing $at_desc ..."
2134 $at_traceon
2135
2136
2137
2138
2139 cat >prog <<'_ATEOF'
2140
2141 foo()
2142 {
2143 }
2144
2145 bar()
2146 {
2147 foo();
2148 }
2149
2150 main()
2151 {
2152 bar();
2153 foo();
2154 }
2155
2156 _ATEOF
2157
2158
2159 cat >expout <<'_ATEOF'
2160 main() <main () at prog:11>:
2161 bar() <bar () at prog:6>:
2162 foo() <foo () at prog:2>
2163 foo() <foo () at prog:2>
2164 _ATEOF
2165
2166 { set +x
2167 printf "%s\n" "$at_srcdir/direct.at:20: cflow prog"
2168 at_fn_check_prepare_trace "direct.at:20"
2169 ( $at_check_trace; cflow prog
2170 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2171 at_status=$? at_failed=false
2172 $at_check_filter
2173 at_fn_diff_devnull "$at_stderr" || at_failed=:
2174 $at_diff expout "$at_stdout" || at_failed=:
2175 at_fn_check_status 0 $at_status "$at_srcdir/direct.at:20"
2176 $at_failed && at_fn_log_failure
2177 $at_traceon; }
2178
2179
2180 set +x
2181 $at_times_p && times >"$at_times_file"
2182 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2183 read at_status <"$at_status_file"
2184 #AT_STOP_2
2185 #AT_START_3
2186 at_fn_group_banner 3 'reverse.at:17' \
2187 "reverse tree" " "
2188 at_xfail=no
2189 (
2190 printf "%s\n" "3. $at_setup_line: testing $at_desc ..."
2191 $at_traceon
2192
2193
2194
2195
2196
2197
2198
2199
2200 cat >prog <<'_ATEOF'
2201
2202 foo()
2203 {
2204 }
2205
2206 bar()
2207 {
2208 foo();
2209 }
2210
2211 main()
2212 {
2213 bar();
2214 foo();
2215 }
2216
2217 _ATEOF
2218
2219
2220 cat >expout <<'_ATEOF'
2221 bar() <bar () at prog:6>:
2222 main() <main () at prog:11>
2223 foo() <foo () at prog:2>:
2224 bar() <bar () at prog:6>:
2225 main() <main () at prog:11>
2226 main() <main () at prog:11>
2227 main() <main () at prog:11>
2228 _ATEOF
2229
2230 { set +x
2231 printf "%s\n" "$at_srcdir/reverse.at:20: cflow -r prog"
2232 at_fn_check_prepare_trace "reverse.at:20"
2233 ( $at_check_trace; cflow -r prog
2234 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2235 at_status=$? at_failed=false
2236 $at_check_filter
2237 at_fn_diff_devnull "$at_stderr" || at_failed=:
2238 $at_diff expout "$at_stdout" || at_failed=:
2239 at_fn_check_status 0 $at_status "$at_srcdir/reverse.at:20"
2240 $at_failed && at_fn_log_failure
2241 $at_traceon; }
2242
2243
2244
2245 set +x
2246 $at_times_p && times >"$at_times_file"
2247 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2248 read at_status <"$at_status_file"
2249 #AT_STOP_3
2250 #AT_START_4
2251 at_fn_group_banner 4 'recurse.at:17' \
2252 "recursive calls" " "
2253 at_xfail=no
2254 (
2255 printf "%s\n" "4. $at_setup_line: testing $at_desc ..."
2256 $at_traceon
2257
2258
2259
2260
2261 cat >prog <<'_ATEOF'
2262
2263 foo()
2264 {
2265 bar();
2266 }
2267
2268 bar()
2269 {
2270 bar();
2271 foo();
2272 }
2273
2274 main()
2275 {
2276 bar();
2277 }
2278
2279 _ATEOF
2280
2281
2282 cat >expout <<'_ATEOF'
2283 main() <main () at prog:13>:
2284 bar() <bar () at prog:7> (R):
2285 bar() <bar () at prog:7> (recursive: see 2)
2286 foo() <foo () at prog:2> (R):
2287 bar() <bar () at prog:7> (recursive: see 2)
2288 _ATEOF
2289
2290 { set +x
2291 printf "%s\n" "$at_srcdir/recurse.at:20: cflow prog"
2292 at_fn_check_prepare_trace "recurse.at:20"
2293 ( $at_check_trace; cflow prog
2294 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2295 at_status=$? at_failed=false
2296 $at_check_filter
2297 at_fn_diff_devnull "$at_stderr" || at_failed=:
2298 $at_diff expout "$at_stdout" || at_failed=:
2299 at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:20"
2300 $at_failed && at_fn_log_failure
2301 $at_traceon; }
2302
2303
2304 set +x
2305 $at_times_p && times >"$at_times_file"
2306 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2307 read at_status <"$at_status_file"
2308 #AT_STOP_4
2309 #AT_START_5
2310 at_fn_group_banner 5 'attr.at:17' \
2311 "attribute handling" " "
2312 at_xfail=no
2313 (
2314 printf "%s\n" "5. $at_setup_line: testing $at_desc ..."
2315 $at_traceon
2316
2317
2318
2319
2320
2321
2322
2323 # Early versions of cflow coredumped on this output
2324
2325 cat >prog <<'_ATEOF'
2326
2327 extern main() __attribute__((noreturn));
2328
2329 main()
2330 {
2331 foo();
2332 }
2333
2334 _ATEOF
2335
2336
2337 cat >expout <<'_ATEOF'
2338 main() <main () at prog:4>:
2339 foo()
2340 _ATEOF
2341
2342 { set +x
2343 printf "%s\n" "$at_srcdir/attr.at:20: cflow -v prog"
2344 at_fn_check_prepare_trace "attr.at:20"
2345 ( $at_check_trace; cflow -v prog
2346 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2347 at_status=$? at_failed=false
2348 $at_check_filter
2349 echo >>"$at_stderr"; printf "%s\n" "prog:2: expected \`;' near \`__attribute__'
2350 " | \
2351 $at_diff - "$at_stderr" || at_failed=:
2352 $at_diff expout "$at_stdout" || at_failed=:
2353 at_fn_check_status 0 $at_status "$at_srcdir/attr.at:20"
2354 $at_failed && at_fn_log_failure
2355 $at_traceon; }
2356
2357
2358
2359
2360
2361 set +x
2362 $at_times_p && times >"$at_times_file"
2363 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2364 read at_status <"$at_status_file"
2365 #AT_STOP_5
2366 #AT_START_6
2367 at_fn_group_banner 6 'awrapper.at:17' \
2368 "attribute wrapper handling" " "
2369 at_xfail=no
2370 (
2371 printf "%s\n" "6. $at_setup_line: testing $at_desc ..."
2372 $at_traceon
2373
2374
2375
2376
2377
2378
2379
2380 # Early versions of cflow coredumped on this output
2381
2382 cat >prog <<'_ATEOF'
2383
2384 extern main() __attribute__((noreturn));
2385
2386 main()
2387 {
2388 foo();
2389 }
2390
2391 _ATEOF
2392
2393
2394 cat >expout <<'_ATEOF'
2395 main() <main () at prog:4>:
2396 foo()
2397 _ATEOF
2398
2399 { set +x
2400 printf "%s\n" "$at_srcdir/awrapper.at:20: cflow --symbol __attribute__:wrapper prog"
2401 at_fn_check_prepare_trace "awrapper.at:20"
2402 ( $at_check_trace; cflow --symbol __attribute__:wrapper prog
2403 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2404 at_status=$? at_failed=false
2405 $at_check_filter
2406 at_fn_diff_devnull "$at_stderr" || at_failed=:
2407 $at_diff expout "$at_stdout" || at_failed=:
2408 at_fn_check_status 0 $at_status "$at_srcdir/awrapper.at:20"
2409 $at_failed && at_fn_log_failure
2410 $at_traceon; }
2411
2412
2413
2414
2415
2416 set +x
2417 $at_times_p && times >"$at_times_file"
2418 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2419 read at_status <"$at_status_file"
2420 #AT_STOP_6
2421 #AT_START_7
2422 at_fn_group_banner 7 'pwrapper.at:17' \
2423 "parameter wrapper handling" " "
2424 at_xfail=no
2425 (
2426 printf "%s\n" "7. $at_setup_line: testing $at_desc ..."
2427 $at_traceon
2428
2429
2430
2431
2432
2433
2434
2435
2436 cat >prog <<'_ATEOF'
2437
2438 int foo PARM((int x, int y));
2439
2440 int
2441 foo(int x, int y)
2442 {
2443 bar();
2444 }
2445
2446 _ATEOF
2447
2448
2449 cat >expout <<'_ATEOF'
2450 foo() <int foo (int x, int y) at prog:5>:
2451 bar()
2452 _ATEOF
2453
2454 { set +x
2455 printf "%s\n" "$at_srcdir/pwrapper.at:20: cflow --symbol PARM:wrapper prog"
2456 at_fn_check_prepare_trace "pwrapper.at:20"
2457 ( $at_check_trace; cflow --symbol PARM:wrapper prog
2458 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2459 at_status=$? at_failed=false
2460 $at_check_filter
2461 at_fn_diff_devnull "$at_stderr" || at_failed=:
2462 $at_diff expout "$at_stdout" || at_failed=:
2463 at_fn_check_status 0 $at_status "$at_srcdir/pwrapper.at:20"
2464 $at_failed && at_fn_log_failure
2465 $at_traceon; }
2466
2467
2468
2469 set +x
2470 $at_times_p && times >"$at_times_file"
2471 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2472 read at_status <"$at_status_file"
2473 #AT_STOP_7
2474 #AT_START_8
2475 at_fn_group_banner 8 'knr.at:17' \
2476 "K&R style function declarations" " "
2477 at_xfail=no
2478 (
2479 printf "%s\n" "8. $at_setup_line: testing $at_desc ..."
2480 $at_traceon
2481
2482
2483
2484 # Cflow versions 1.0 and 1.1 improperly handled K&R style declarations.
2485 # Reported by: "Robert E. Michael" <[email protected]>
2486 # References: <[email protected]>
2487
2488
2489 cat >prog <<'_ATEOF'
2490
2491 main(argc, argv)
2492 int argc;
2493 char *argv
2494 {
2495 foo(argc);
2496 }
2497
2498 void
2499 foo(x)
2500 TYPE x;
2501 {
2502 x;
2503 }
2504
2505 _ATEOF
2506
2507
2508 cat >expout <<'_ATEOF'
2509 main() <main (argc, argv) at prog:2>:
2510 foo() <void foo (x) at prog:10>
2511 _ATEOF
2512
2513 { set +x
2514 printf "%s\n" "$at_srcdir/knr.at:24: cflow prog"
2515 at_fn_check_prepare_trace "knr.at:24"
2516 ( $at_check_trace; cflow prog
2517 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2518 at_status=$? at_failed=false
2519 $at_check_filter
2520 at_fn_diff_devnull "$at_stderr" || at_failed=:
2521 $at_diff expout "$at_stdout" || at_failed=:
2522 at_fn_check_status 0 $at_status "$at_srcdir/knr.at:24"
2523 $at_failed && at_fn_log_failure
2524 $at_traceon; }
2525
2526
2527 set +x
2528 $at_times_p && times >"$at_times_file"
2529 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2530 read at_status <"$at_status_file"
2531 #AT_STOP_8
2532 #AT_START_9
2533 at_fn_group_banner 9 'fdecl.at:17' \
2534 "forward function declarations" " "
2535 at_xfail=no
2536 (
2537 printf "%s\n" "9. $at_setup_line: testing $at_desc ..."
2538 $at_traceon
2539
2540
2541
2542
2543
2544
2545
2546 cat >prog <<'_ATEOF'
2547
2548 int foo(int x,int y), bar(long u);
2549
2550 int
2551 foo(int x, int y)
2552 {
2553 bar();
2554 }
2555
2556 _ATEOF
2557
2558
2559 cat >expout <<'_ATEOF'
2560 foo() <int foo (int x, int y) at prog:5>:
2561 bar()
2562 _ATEOF
2563
2564 { set +x
2565 printf "%s\n" "$at_srcdir/fdecl.at:20: cflow -v prog"
2566 at_fn_check_prepare_trace "fdecl.at:20"
2567 ( $at_check_trace; cflow -v prog
2568 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2569 at_status=$? at_failed=false
2570 $at_check_filter
2571 at_fn_diff_devnull "$at_stderr" || at_failed=:
2572 $at_diff expout "$at_stdout" || at_failed=:
2573 at_fn_check_status 0 $at_status "$at_srcdir/fdecl.at:20"
2574 $at_failed && at_fn_log_failure
2575 $at_traceon; }
2576
2577
2578
2579
2580 set +x
2581 $at_times_p && times >"$at_times_file"
2582 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2583 read at_status <"$at_status_file"
2584 #AT_STOP_9
2585 #AT_START_10
2586 at_fn_group_banner 10 'static.at:17' \
2587 "Static symbols with forward decls and -i^s" " "
2588 at_xfail=no
2589 (
2590 printf "%s\n" "10. $at_setup_line: testing $at_desc ..."
2591 $at_traceon
2592
2593
2594
2595 # Up to version 1.1 static symbols with forward declarations caused
2596 # segmentation faults when used with -i^s.
2597 #
2598 # Synopsis: Normally static functions are not added to callee lists
2599 # of their callers in -i^s mode (see add_reference() and call() in parser.c),
2600 # therefore cflow 1.1 assumed it was safe to free them in static_processor().
2601 # However, there is an important exception: if the function storage type is
2602 # not known at the time of reference. Such functions are added to callee lists
2603 # and freeing them causes coredumps.
2604 #
2605 # To reproduce the case we need two source files: first with the actual test
2606 # program and the second, empty, one, whose purpose is to trigger additional
2607 # memory allocations after symbol deletion.
2608 #
2609 # Reported by: Laurent Fournie
2610 # References: <OFA772D453.E40E7252-ONC12571D8.0046430B-C12571D8.004B043A@rockwellcollins.com>
2611
2612 cat >prog <<'_ATEOF'
2613
2614 static void foo();
2615
2616 int
2617 bar()
2618 {
2619 foo();
2620 }
2621
2622 static void
2623 foo()
2624 {
2625 int x = 1;
2626 }
2627 _ATEOF
2628
2629
2630 cat >2 <<'_ATEOF'
2631
2632 _ATEOF
2633
2634
2635
2636
2637
2638
2639 cat >expout <<'_ATEOF'
2640 bar() <int bar () at prog:5>:
2641 _ATEOF
2642
2643 { set +x
2644 printf "%s\n" "$at_srcdir/static.at:56: cflow -i^s prog 2"
2645 at_fn_check_prepare_trace "static.at:56"
2646 ( $at_check_trace; cflow -i^s prog 2
2647 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2648 at_status=$? at_failed=false
2649 $at_check_filter
2650 at_fn_diff_devnull "$at_stderr" || at_failed=:
2651 $at_diff expout "$at_stdout" || at_failed=:
2652 at_fn_check_status 0 $at_status "$at_srcdir/static.at:56"
2653 $at_failed && at_fn_log_failure
2654 $at_traceon; }
2655
2656
2657
2658
2659 set +x
2660 $at_times_p && times >"$at_times_file"
2661 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2662 read at_status <"$at_status_file"
2663 #AT_STOP_10
2664 #AT_START_11
2665 at_fn_group_banner 11 'include.at:17' \
2666 "included symbols" " "
2667 at_xfail=no
2668 (
2669 printf "%s\n" "11. $at_setup_line: testing $at_desc ..."
2670 $at_traceon
2671
2672
2673
2674 cat >prog <<'_ATEOF'
2675
2676 int a;
2677 long _b;
2678 static int c;
2679
2680 static void
2681 _bar(int x)
2682 {
2683 a = x;
2684 }
2685
2686 int
2687 foo(int y)
2688 {
2689 _b = y;
2690 c = y;
2691 _bar();
2692 return 1;
2693 }
2694
2695 int
2696 main()
2697 {
2698 static int d = foo(2);
2699 return d;
2700 }
2701 _ATEOF
2702
2703
2704
2705
2706
2707
2708 cat >expout <<'_ATEOF'
2709 main() <int main () at prog:22>:
2710 foo() <int foo (int y) at prog:13>:
2711 _ATEOF
2712
2713 { set +x
2714 printf "%s\n" "$at_srcdir/include.at:48: cflow -v prog"
2715 at_fn_check_prepare_trace "include.at:48"
2716 ( $at_check_trace; cflow -v prog
2717 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2718 at_status=$? at_failed=false
2719 $at_check_filter
2720 at_fn_diff_devnull "$at_stderr" || at_failed=:
2721 $at_diff expout "$at_stdout" || at_failed=:
2722 at_fn_check_status 0 $at_status "$at_srcdir/include.at:48"
2723 $at_failed && at_fn_log_failure
2724 $at_traceon; }
2725
2726
2727
2728
2729
2730
2731
2732 cat >expout <<'_ATEOF'
2733 main() <int main () at prog:22>:
2734 foo() <int foo (int y) at prog:13>:
2735 _bar() <void _bar (int x) at prog:7>:
2736 _ATEOF
2737
2738 { set +x
2739 printf "%s\n" "$at_srcdir/include.at:54: cflow -v -i_ prog"
2740 at_fn_check_prepare_trace "include.at:54"
2741 ( $at_check_trace; cflow -v -i_ prog
2742 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2743 at_status=$? at_failed=false
2744 $at_check_filter
2745 at_fn_diff_devnull "$at_stderr" || at_failed=:
2746 $at_diff expout "$at_stdout" || at_failed=:
2747 at_fn_check_status 0 $at_status "$at_srcdir/include.at:54"
2748 $at_failed && at_fn_log_failure
2749 $at_traceon; }
2750
2751
2752
2753
2754
2755
2756
2757 cat >expout <<'_ATEOF'
2758 main() <int main () at prog:22>:
2759 foo() <int foo (int y) at prog:13>:
2760 c <int c at prog:4>
2761 d <int d at prog:24>
2762 _ATEOF
2763
2764 { set +x
2765 printf "%s\n" "$at_srcdir/include.at:61: cflow -v -ix prog"
2766 at_fn_check_prepare_trace "include.at:61"
2767 ( $at_check_trace; cflow -v -ix prog
2768 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2769 at_status=$? at_failed=false
2770 $at_check_filter
2771 at_fn_diff_devnull "$at_stderr" || at_failed=:
2772 $at_diff expout "$at_stdout" || at_failed=:
2773 at_fn_check_status 0 $at_status "$at_srcdir/include.at:61"
2774 $at_failed && at_fn_log_failure
2775 $at_traceon; }
2776
2777
2778
2779
2780
2781
2782
2783 cat >expout <<'_ATEOF'
2784 main() <int main () at prog:22>:
2785 foo() <int foo (int y) at prog:13>:
2786 _b <long _b at prog:3>
2787 c <int c at prog:4>
2788 _bar() <void _bar (int x) at prog:7>:
2789 a <int a at prog:2>
2790 d <int d at prog:24>
2791 _ATEOF
2792
2793 { set +x
2794 printf "%s\n" "$at_srcdir/include.at:69: cflow -v -ix_ prog"
2795 at_fn_check_prepare_trace "include.at:69"
2796 ( $at_check_trace; cflow -v -ix_ prog
2797 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2798 at_status=$? at_failed=false
2799 $at_check_filter
2800 at_fn_diff_devnull "$at_stderr" || at_failed=:
2801 $at_diff expout "$at_stdout" || at_failed=:
2802 at_fn_check_status 0 $at_status "$at_srcdir/include.at:69"
2803 $at_failed && at_fn_log_failure
2804 $at_traceon; }
2805
2806
2807
2808
2809
2810
2811
2812 cat >expout <<'_ATEOF'
2813 main() <int main () at prog:22>:
2814 foo() <int foo (int y) at prog:13>:
2815 _b <long _b at prog:3>
2816 _ATEOF
2817
2818 { set +x
2819 printf "%s\n" "$at_srcdir/include.at:80: cflow -v -ix_ -i^s prog"
2820 at_fn_check_prepare_trace "include.at:80"
2821 ( $at_check_trace; cflow -v -ix_ -i^s prog
2822 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2823 at_status=$? at_failed=false
2824 $at_check_filter
2825 at_fn_diff_devnull "$at_stderr" || at_failed=:
2826 $at_diff expout "$at_stdout" || at_failed=:
2827 at_fn_check_status 0 $at_status "$at_srcdir/include.at:80"
2828 $at_failed && at_fn_log_failure
2829 $at_traceon; }
2830
2831
2832
2833 set +x
2834 $at_times_p && times >"$at_times_file"
2835 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2836 read at_status <"$at_status_file"
2837 #AT_STOP_11
2838 #AT_START_12
2839 at_fn_group_banner 12 'ssblock.at:17' \
2840 "static struct in block scope" " "
2841 at_xfail=no
2842 (
2843 printf "%s\n" "12. $at_setup_line: testing $at_desc ..."
2844 $at_traceon
2845
2846
2847
2848
2849
2850
2851
2852 cat >prog <<'_ATEOF'
2853
2854 int
2855 foo ()
2856 {
2857 static struct {
2858 int f;
2859 } k[] = { 0 };
2860 k[0]=1;
2861 }
2862
2863 int
2864 main()
2865 {
2866 foo();
2867 }
2868
2869 _ATEOF
2870
2871
2872 cat >expout <<'_ATEOF'
2873 main() <int main () at prog:12>:
2874 foo() <int foo () at prog:3>:
2875 k <struct { ... } k[] at prog:7>
2876 _ATEOF
2877
2878 { set +x
2879 printf "%s\n" "$at_srcdir/ssblock.at:20: cflow -v -ix prog"
2880 at_fn_check_prepare_trace "ssblock.at:20"
2881 ( $at_check_trace; cflow -v -ix prog
2882 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2883 at_status=$? at_failed=false
2884 $at_check_filter
2885 at_fn_diff_devnull "$at_stderr" || at_failed=:
2886 $at_diff expout "$at_stdout" || at_failed=:
2887 at_fn_check_status 0 $at_status "$at_srcdir/ssblock.at:20"
2888 $at_failed && at_fn_log_failure
2889 $at_traceon; }
2890
2891
2892
2893
2894 set +x
2895 $at_times_p && times >"$at_times_file"
2896 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2897 read at_status <"$at_status_file"
2898 #AT_STOP_12
2899 #AT_START_13
2900 at_fn_group_banner 13 'funcarg.at:17' \
2901 "functional arguments" " "
2902 at_xfail=no
2903 (
2904 printf "%s\n" "13. $at_setup_line: testing $at_desc ..."
2905 $at_traceon
2906
2907
2908
2909
2910
2911
2912
2913 cat >prog <<'_ATEOF'
2914
2915 int
2916 foo(int bar())
2917 {
2918 bar();
2919 }
2920 _ATEOF
2921
2922
2923 cat >expout <<'_ATEOF'
2924 foo() <int foo (int bar ()) at prog:3>
2925 _ATEOF
2926
2927 { set +x
2928 printf "%s\n" "$at_srcdir/funcarg.at:20: cflow -v --main=foo prog"
2929 at_fn_check_prepare_trace "funcarg.at:20"
2930 ( $at_check_trace; cflow -v --main=foo prog
2931 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2932 at_status=$? at_failed=false
2933 $at_check_filter
2934 at_fn_diff_devnull "$at_stderr" || at_failed=:
2935 $at_diff expout "$at_stdout" || at_failed=:
2936 at_fn_check_status 0 $at_status "$at_srcdir/funcarg.at:20"
2937 $at_failed && at_fn_log_failure
2938 $at_traceon; }
2939
2940
2941
2942
2943 set +x
2944 $at_times_p && times >"$at_times_file"
2945 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
2946 read at_status <"$at_status_file"
2947 #AT_STOP_13
2948 #AT_START_14
2949 at_fn_group_banner 14 'parm.at:17' \
2950 "function parameter handling" " "
2951 at_xfail=no
2952 (
2953 printf "%s\n" "14. $at_setup_line: testing $at_desc ..."
2954 $at_traceon
2955
2956
2957
2958
2959
2960
2961
2962 cat >prog <<'_ATEOF'
2963
2964 int bar;
2965 /* This declaration used to shadow the global in
2966 pre-1.0 versions */
2967 int (*foo) (int bar);
2968
2969 int
2970 main()
2971 {
2972 bar = 1;
2973 }
2974
2975 _ATEOF
2976
2977
2978 cat >expout <<'_ATEOF'
2979 main() <int main () at prog:8>:
2980 bar <int bar at prog:2>
2981 _ATEOF
2982
2983 { set +x
2984 printf "%s\n" "$at_srcdir/parm.at:20: cflow -ix -v prog"
2985 at_fn_check_prepare_trace "parm.at:20"
2986 ( $at_check_trace; cflow -ix -v prog
2987 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
2988 at_status=$? at_failed=false
2989 $at_check_filter
2990 at_fn_diff_devnull "$at_stderr" || at_failed=:
2991 $at_diff expout "$at_stdout" || at_failed=:
2992 at_fn_check_status 0 $at_status "$at_srcdir/parm.at:20"
2993 $at_failed && at_fn_log_failure
2994 $at_traceon; }
2995
2996
2997
2998 set +x
2999 $at_times_p && times >"$at_times_file"
3000 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3001 read at_status <"$at_status_file"
3002 #AT_STOP_14
3003 #AT_START_15
3004 at_fn_group_banner 15 'nfparg.at:19' \
3005 "nameless function pointer arguments" " "
3006 at_xfail=no
3007 (
3008 printf "%s\n" "15. $at_setup_line: testing $at_desc ..."
3009 $at_traceon
3010
3011
3012
3013
3014 cat >prog <<'_ATEOF'
3015
3016 int main(int (*) ())
3017 {
3018 }
3019
3020 _ATEOF
3021
3022
3023 cat >expout <<'_ATEOF'
3024 main() <int main (int (*) ()) at prog:2>
3025 _ATEOF
3026
3027 { set +x
3028 printf "%s\n" "$at_srcdir/nfparg.at:22: cflow prog"
3029 at_fn_check_prepare_trace "nfparg.at:22"
3030 ( $at_check_trace; cflow prog
3031 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3032 at_status=$? at_failed=false
3033 $at_check_filter
3034 at_fn_diff_devnull "$at_stderr" || at_failed=:
3035 $at_diff expout "$at_stdout" || at_failed=:
3036 at_fn_check_status 0 $at_status "$at_srcdir/nfparg.at:22"
3037 $at_failed && at_fn_log_failure
3038 $at_traceon; }
3039
3040
3041 set +x
3042 $at_times_p && times >"$at_times_file"
3043 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3044 read at_status <"$at_status_file"
3045 #AT_STOP_15
3046 #AT_START_16
3047 at_fn_group_banner 16 'nfarg.at:24' \
3048 "nameless function arguments" " "
3049 at_xfail=no
3050 (
3051 printf "%s\n" "16. $at_setup_line: testing $at_desc ..."
3052 $at_traceon
3053
3054
3055
3056
3057 cat >prog <<'_ATEOF'
3058
3059 int main(int ())
3060 {
3061 }
3062
3063 _ATEOF
3064
3065
3066 cat >expout <<'_ATEOF'
3067 main() <int main (int ()) at prog:2>
3068 _ATEOF
3069
3070 { set +x
3071 printf "%s\n" "$at_srcdir/nfarg.at:27: cflow prog"
3072 at_fn_check_prepare_trace "nfarg.at:27"
3073 ( $at_check_trace; cflow prog
3074 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3075 at_status=$? at_failed=false
3076 $at_check_filter
3077 at_fn_diff_devnull "$at_stderr" || at_failed=:
3078 $at_diff expout "$at_stdout" || at_failed=:
3079 at_fn_check_status 0 $at_status "$at_srcdir/nfarg.at:27"
3080 $at_failed && at_fn_log_failure
3081 $at_traceon; }
3082
3083
3084 set +x
3085 $at_times_p && times >"$at_times_file"
3086 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3087 read at_status <"$at_status_file"
3088 #AT_STOP_16
3089 #AT_START_17
3090 at_fn_group_banner 17 'hiding.at:17' \
3091 "hiding of global and file static identifiers" " "
3092 at_xfail=no
3093 (
3094 printf "%s\n" "17. $at_setup_line: testing $at_desc ..."
3095 $at_traceon
3096
3097
3098
3099
3100
3101
3102
3103
3104 cat >prog <<'_ATEOF'
3105
3106 static int s = 1;
3107 int g = -100;
3108
3109 static
3110 int foo()
3111 {
3112 static int s = 10; /* hides file static variable */
3113 return s;
3114 }
3115
3116 static
3117 int bar()
3118 {
3119 static int foo = 100; /* hides file static function */
3120 return foo + g;
3121 }
3122
3123 int baz()
3124 {
3125 int g = 100; /* hides global variable */
3126 return s + g;
3127 }
3128
3129 int main()
3130 {
3131 return (g + s + foo() + bar() + baz());
3132 }
3133
3134 _ATEOF
3135
3136
3137 cat >expout <<'_ATEOF'
3138 main() <int main () at prog:25>:
3139 g <int g at prog:3>
3140 s <int s at prog:2>
3141 foo() <int foo () at prog:6>:
3142 s <int s at prog:8>
3143 bar() <int bar () at prog:13>:
3144 foo <int foo at prog:15>
3145 g <int g at prog:3>
3146 baz() <int baz () at prog:19>:
3147 s <int s at prog:2>
3148 _ATEOF
3149
3150 { set +x
3151 printf "%s\n" "$at_srcdir/hiding.at:20: cflow -ix_ prog"
3152 at_fn_check_prepare_trace "hiding.at:20"
3153 ( $at_check_trace; cflow -ix_ prog
3154 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3155 at_status=$? at_failed=false
3156 $at_check_filter
3157 at_fn_diff_devnull "$at_stderr" || at_failed=:
3158 $at_diff expout "$at_stdout" || at_failed=:
3159 at_fn_check_status 0 $at_status "$at_srcdir/hiding.at:20"
3160 $at_failed && at_fn_log_failure
3161 $at_traceon; }
3162
3163
3164
3165
3166 set +x
3167 $at_times_p && times >"$at_times_file"
3168 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3169 read at_status <"$at_status_file"
3170 #AT_STOP_17
3171 #AT_START_18
3172 at_fn_group_banner 18 'multi.at:17' \
3173 "multiple source files" " "
3174 at_xfail=no
3175 (
3176 printf "%s\n" "18. $at_setup_line: testing $at_desc ..."
3177 $at_traceon
3178
3179
3180
3181
3182
3183
3184
3185 cat >multi1 <<'_ATEOF'
3186
3187 #include "multi2.h"
3188 #include "multi3.h"
3189
3190 static int stat = 1;
3191
3192 int main(int argc, char **argv)
3193 {
3194 static int local_stat;
3195 local_stat = foo1(glob) + foo2(stat);
3196 return local_stat;
3197 }
3198 _ATEOF
3199
3200
3201 cat >multi2 <<'_ATEOF'
3202
3203 #include "multi2.h"
3204 #include "multi3.h"
3205
3206 int glob = 2;
3207 static int stat = 10;
3208
3209 static void _bar(int x)
3210 {
3211 glob = foo2(x);
3212 }
3213
3214 int foo1(int y)
3215 {
3216 int local = 1;
3217 _bar(local);
3218 return stat;
3219 }
3220 _ATEOF
3221
3222
3223 cat >multi3 <<'_ATEOF'
3224
3225 #include "multi3.h"
3226
3227 static int stat = 100;
3228
3229 static void _bar(int x)
3230 {
3231 stat += x;
3232 }
3233
3234 int foo2(int y)
3235 {
3236 static int local_stat = 1;
3237 _bar(local_stat + y + glob);
3238 return local_stat;
3239 }
3240 _ATEOF
3241
3242
3243 cat >expout <<'_ATEOF'
3244 main() <int main (int argc, char **argv) at multi1:7>:
3245 local_stat <int local_stat at multi1:9>
3246 foo1() <int foo1 (int y) at multi2:13>:
3247 _bar() <void _bar (int x) at multi2:8>:
3248 glob <int glob at multi2:5>
3249 foo2() <int foo2 (int y) at multi3:11>:
3250 _bar() <void _bar (int x) at multi3:6>:
3251 stat <int stat at multi3:4>
3252 local_stat <int local_stat at multi3:13>
3253 glob <int glob at multi2:5>
3254 stat <int stat at multi2:6>
3255 glob <int glob at multi2:5>
3256 foo2() <int foo2 (int y) at multi3:11>:
3257 _bar() <void _bar (int x) at multi3:6>:
3258 stat <int stat at multi3:4>
3259 local_stat <int local_stat at multi3:13>
3260 glob <int glob at multi2:5>
3261 stat <int stat at multi1:5>
3262 _ATEOF
3263
3264
3265 { set +x
3266 printf "%s\n" "$at_srcdir/multi.at:20: cflow -ix_ multi1 multi2 multi3"
3267 at_fn_check_prepare_trace "multi.at:20"
3268 ( $at_check_trace; cflow -ix_ multi1 multi2 multi3
3269 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3270 at_status=$? at_failed=false
3271 $at_check_filter
3272 at_fn_diff_devnull "$at_stderr" || at_failed=:
3273 $at_diff expout "$at_stdout" || at_failed=:
3274 at_fn_check_status 0 $at_status "$at_srcdir/multi.at:20"
3275 $at_failed && at_fn_log_failure
3276 $at_traceon; }
3277
3278
3279
3280
3281
3282 set +x
3283 $at_times_p && times >"$at_times_file"
3284 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3285 read at_status <"$at_status_file"
3286 #AT_STOP_18
3287 #AT_START_19
3288 at_fn_group_banner 19 'bartest.at:20' \
3289 "vertical bar in tree output" " "
3290 at_xfail=no
3291 (
3292 printf "%s\n" "19. $at_setup_line: testing $at_desc ..."
3293 $at_traceon
3294
3295
3296
3297
3298
3299
3300
3301 cat >prog <<'_ATEOF'
3302 int main()
3303 {
3304 hello(NULL);
3305 printf("Hello\n");
3306 }
3307 hello(const char *data)
3308 {
3309 printf("Hello\n");
3310 }
3311
3312 _ATEOF
3313
3314
3315 cat >expout <<'_ATEOF'
3316 1 +-main() <int main () at prog:1>
3317 2 +-hello() <hello (const char *data) at prog:6>
3318 3 | \-printf()
3319 4 \-printf()
3320 _ATEOF
3321
3322 { set +x
3323 printf "%s\n" "$at_srcdir/bartest.at:23: cflow --tree --number prog"
3324 at_fn_check_prepare_trace "bartest.at:23"
3325 ( $at_check_trace; cflow --tree --number prog
3326 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3327 at_status=$? at_failed=false
3328 $at_check_filter
3329 at_fn_diff_devnull "$at_stderr" || at_failed=:
3330 $at_diff expout "$at_stdout" || at_failed=:
3331 at_fn_check_status 0 $at_status "$at_srcdir/bartest.at:23"
3332 $at_failed && at_fn_log_failure
3333 $at_traceon; }
3334
3335
3336
3337
3338 set +x
3339 $at_times_p && times >"$at_times_file"
3340 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3341 read at_status <"$at_status_file"
3342 #AT_STOP_19
3343 #AT_START_20
3344 at_fn_group_banner 20 'decl01.at:17' \
3345 "same type declaration" " "
3346 at_xfail=no
3347 (
3348 printf "%s\n" "20. $at_setup_line: testing $at_desc ..."
3349 $at_traceon
3350
3351
3352
3353
3354
3355
3356
3357 cat >prog <<'_ATEOF'
3358 static struct X *a, *b, *c;
3359 _ATEOF
3360
3361
3362 : >expout
3363 { set +x
3364 printf "%s\n" "$at_srcdir/decl01.at:20: cflow --debug prog"
3365 at_fn_check_prepare_trace "decl01.at:20"
3366 ( $at_check_trace; cflow --debug prog
3367 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3368 at_status=$? at_failed=false
3369 $at_check_filter
3370 echo >>"$at_stderr"; printf "%s\n" "prog:1: a/-1 defined to struct X *a
3371 prog:1: b/-1 defined to struct X *b
3372 prog:1: c/-1 defined to struct X *c
3373 " | \
3374 $at_diff - "$at_stderr" || at_failed=:
3375 $at_diff expout "$at_stdout" || at_failed=:
3376 at_fn_check_status 0 $at_status "$at_srcdir/decl01.at:20"
3377 $at_failed && at_fn_log_failure
3378 $at_traceon; }
3379
3380
3381
3382 set +x
3383 $at_times_p && times >"$at_times_file"
3384 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3385 read at_status <"$at_status_file"
3386 #AT_STOP_20
3387 #AT_START_21
3388 at_fn_group_banner 21 'invalid.at:17' \
3389 "invalid input" " "
3390 at_xfail=no
3391 (
3392 printf "%s\n" "21. $at_setup_line: testing $at_desc ..."
3393 $at_traceon
3394
3395
3396
3397 # See https://savannah.gnu.org/bugs/?44113
3398
3399 cat >prog <<'_ATEOF'
3400
3401 m{int
3402 r(a(n){}e
3403
3404 _ATEOF
3405
3406
3407 : >expout
3408 { set +x
3409 printf "%s\n" "$at_srcdir/invalid.at:21: cflow prog"
3410 at_fn_check_prepare_trace "invalid.at:21"
3411 ( $at_check_trace; cflow prog
3412 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3413 at_status=$? at_failed=false
3414 $at_check_filter
3415 at_fn_diff_devnull "$at_stderr" || at_failed=:
3416 $at_diff expout "$at_stdout" || at_failed=:
3417 at_fn_check_status 0 $at_status "$at_srcdir/invalid.at:21"
3418 $at_failed && at_fn_log_failure
3419 $at_traceon; }
3420
3421
3422
3423 cat >prog <<'_ATEOF'
3424
3425 e(S,t)e(S{
3426
3427 _ATEOF
3428
3429
3430 : >expout
3431 { set +x
3432 printf "%s\n" "$at_srcdir/invalid.at:26: cflow prog"
3433 at_fn_check_prepare_trace "invalid.at:26"
3434 ( $at_check_trace; cflow prog
3435 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3436 at_status=$? at_failed=false
3437 $at_check_filter
3438 at_fn_diff_devnull "$at_stderr" || at_failed=:
3439 $at_diff expout "$at_stdout" || at_failed=:
3440 at_fn_check_status 0 $at_status "$at_srcdir/invalid.at:26"
3441 $at_failed && at_fn_log_failure
3442 $at_traceon; }
3443
3444
3445
3446 cat >prog <<'_ATEOF'
3447
3448 n{void y(r(i){}a
3449
3450 _ATEOF
3451
3452
3453 : >expout
3454 { set +x
3455 printf "%s\n" "$at_srcdir/invalid.at:30: cflow prog"
3456 at_fn_check_prepare_trace "invalid.at:30"
3457 ( $at_check_trace; cflow prog
3458 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3459 at_status=$? at_failed=false
3460 $at_check_filter
3461 at_fn_diff_devnull "$at_stderr" || at_failed=:
3462 $at_diff expout "$at_stdout" || at_failed=:
3463 at_fn_check_status 0 $at_status "$at_srcdir/invalid.at:30"
3464 $at_failed && at_fn_log_failure
3465 $at_traceon; }
3466
3467
3468 set +x
3469 $at_times_p && times >"$at_times_file"
3470 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3471 read at_status <"$at_status_file"
3472 #AT_STOP_21
3473 #AT_START_22
3474 at_fn_group_banner 22 'memberof.at:17' \
3475 "member of" " "
3476 at_xfail=no
3477 (
3478 printf "%s\n" "22. $at_setup_line: testing $at_desc ..."
3479 $at_traceon
3480
3481
3482
3483
3484 cat >prog <<'_ATEOF'
3485 int bar(struct foo *a) {
3486 return a.bar();
3487 }
3488
3489 _ATEOF
3490
3491
3492 cat >expout <<'_ATEOF'
3493 bar() <int bar (struct foo *a) at prog:1>
3494 _ATEOF
3495
3496 { set +x
3497 printf "%s\n" "$at_srcdir/memberof.at:20: cflow prog"
3498 at_fn_check_prepare_trace "memberof.at:20"
3499 ( $at_check_trace; cflow prog
3500 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3501 at_status=$? at_failed=false
3502 $at_check_filter
3503 at_fn_diff_devnull "$at_stderr" || at_failed=:
3504 $at_diff expout "$at_stdout" || at_failed=:
3505 at_fn_check_status 0 $at_status "$at_srcdir/memberof.at:20"
3506 $at_failed && at_fn_log_failure
3507 $at_traceon; }
3508
3509
3510 # https://savannah.gnu.org/bugs/index.php?47110
3511
3512 cat >prog <<'_ATEOF'
3513 int bar(struct foo *a) {
3514 return (*a).bar();
3515 }
3516
3517 _ATEOF
3518
3519
3520 cat >expout <<'_ATEOF'
3521 bar() <int bar (struct foo *a) at prog:1>
3522 _ATEOF
3523
3524 { set +x
3525 printf "%s\n" "$at_srcdir/memberof.at:29: cflow prog"
3526 at_fn_check_prepare_trace "memberof.at:29"
3527 ( $at_check_trace; cflow prog
3528 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3529 at_status=$? at_failed=false
3530 $at_check_filter
3531 at_fn_diff_devnull "$at_stderr" || at_failed=:
3532 $at_diff expout "$at_stdout" || at_failed=:
3533 at_fn_check_status 0 $at_status "$at_srcdir/memberof.at:29"
3534 $at_failed && at_fn_log_failure
3535 $at_traceon; }
3536
3537
3538
3539 cat >prog <<'_ATEOF'
3540 int bar(struct foo **a) {
3541 return (*a)->bar();
3542 }
3543
3544 _ATEOF
3545
3546
3547 cat >expout <<'_ATEOF'
3548 bar() <int bar (struct foo **a) at prog:1>
3549 _ATEOF
3550
3551 { set +x
3552 printf "%s\n" "$at_srcdir/memberof.at:37: cflow prog"
3553 at_fn_check_prepare_trace "memberof.at:37"
3554 ( $at_check_trace; cflow prog
3555 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3556 at_status=$? at_failed=false
3557 $at_check_filter
3558 at_fn_diff_devnull "$at_stderr" || at_failed=:
3559 $at_diff expout "$at_stdout" || at_failed=:
3560 at_fn_check_status 0 $at_status "$at_srcdir/memberof.at:37"
3561 $at_failed && at_fn_log_failure
3562 $at_traceon; }
3563
3564
3565
3566 cat >prog <<'_ATEOF'
3567 int bar(void *a) {
3568 return (*(struct foo*)a).bar();
3569 }
3570
3571 _ATEOF
3572
3573
3574 cat >expout <<'_ATEOF'
3575 bar() <int bar (void *a) at prog:1>
3576 _ATEOF
3577
3578 { set +x
3579 printf "%s\n" "$at_srcdir/memberof.at:45: cflow prog"
3580 at_fn_check_prepare_trace "memberof.at:45"
3581 ( $at_check_trace; cflow prog
3582 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3583 at_status=$? at_failed=false
3584 $at_check_filter
3585 at_fn_diff_devnull "$at_stderr" || at_failed=:
3586 $at_diff expout "$at_stdout" || at_failed=:
3587 at_fn_check_status 0 $at_status "$at_srcdir/memberof.at:45"
3588 $at_failed && at_fn_log_failure
3589 $at_traceon; }
3590
3591
3592
3593 cat >prog <<'_ATEOF'
3594 int bar(void *a) {
3595 return (*(struct foo*)(((struct qux*)a)->foo)).bar();
3596 }
3597
3598 _ATEOF
3599
3600
3601 cat >expout <<'_ATEOF'
3602 bar() <int bar (void *a) at prog:1>
3603 _ATEOF
3604
3605 { set +x
3606 printf "%s\n" "$at_srcdir/memberof.at:53: cflow prog"
3607 at_fn_check_prepare_trace "memberof.at:53"
3608 ( $at_check_trace; cflow prog
3609 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3610 at_status=$? at_failed=false
3611 $at_check_filter
3612 at_fn_diff_devnull "$at_stderr" || at_failed=:
3613 $at_diff expout "$at_stdout" || at_failed=:
3614 at_fn_check_status 0 $at_status "$at_srcdir/memberof.at:53"
3615 $at_failed && at_fn_log_failure
3616 $at_traceon; }
3617
3618
3619 set +x
3620 $at_times_p && times >"$at_times_file"
3621 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3622 read at_status <"$at_status_file"
3623 #AT_STOP_22
3624 #AT_START_23
3625 at_fn_group_banner 23 'num.at:17' \
3626 "numeric constants" " "
3627 at_xfail=no
3628 (
3629 printf "%s\n" "23. $at_setup_line: testing $at_desc ..."
3630 $at_traceon
3631
3632
3633
3634 cat >prog <<'_ATEOF'
3635 int u1 = 10;
3636 unsigned u2 = 10u;
3637 unsigned long u3 = 10ul;
3638 unsigned long long u4 = 10ull;
3639 long u5 = 10l;
3640 unsigned long u6 = 10lu;
3641 unsigned long long u7 = 10llu;
3642
3643 unsigned U2 = 10U;
3644 unsigned long U3 = 10UL;
3645 unsigned long long U4 = 10ULL;
3646 long U5 = 10L;
3647 unsigned long U6 = 10LU;
3648 unsigned long long U7 = 10LLU;
3649
3650 long s1 = -10l;
3651 long s2 = -10ll;
3652 long S1 = -10L;
3653 long S2 = -10LL;
3654
3655 int o1 = 010;
3656 unsigned o2 = 010u;
3657 unsigned long o3 = 010ul;
3658 unsigned long long o4 = 010ull;
3659 long o5 = 010l;
3660 unsigned long o6 = 010lu;
3661 unsigned long long o7 = 010llu;
3662
3663 unsigned O2 = 010U;
3664 unsigned long O3 = 010UL;
3665 unsigned long long O4 = 010ULL;
3666 long O5 = 010L;
3667 unsigned long O6 = 010LU;
3668 unsigned long long O7 = 010LLU;
3669
3670
3671 unsigned x2 = 0x10u;
3672 unsigned long x3 = 0x10ul;
3673 unsigned long long x4 = 0x10ull;
3674 long x5 = 0x10l;
3675 unsigned long x6 = 0x10lu;
3676 unsigned long long x7 = 0x10llu;
3677
3678 unsigned X2 = 0x10U;
3679 unsigned long X3 = 0x10UL;
3680 unsigned long long X4 = 0x10ULL;
3681 long X5 = 0x10L;
3682 unsigned long X6 = 0x10LU;
3683 unsigned long long X7 = 0x10LLU;
3684
3685 _ATEOF
3686
3687
3688 cat >expout <<'_ATEOF'
3689 O2 <unsigned O2 at prog:29>
3690 O3 <unsigned long O3 at prog:30>
3691 O4 <unsigned long long O4 at prog:31>
3692 O5 <long O5 at prog:32>
3693 O6 <unsigned long O6 at prog:33>
3694 O7 <unsigned long long O7 at prog:34>
3695 S1 <long S1 at prog:18>
3696 S2 <long S2 at prog:19>
3697 U2 <unsigned U2 at prog:9>
3698 U3 <unsigned long U3 at prog:10>
3699 U4 <unsigned long long U4 at prog:11>
3700 U5 <long U5 at prog:12>
3701 U6 <unsigned long U6 at prog:13>
3702 U7 <unsigned long long U7 at prog:14>
3703 X2 <unsigned X2 at prog:44>
3704 X3 <unsigned long X3 at prog:45>
3705 X4 <unsigned long long X4 at prog:46>
3706 X5 <long X5 at prog:47>
3707 X6 <unsigned long X6 at prog:48>
3708 X7 <unsigned long long X7 at prog:49>
3709 o1 <int o1 at prog:21>
3710 o2 <unsigned o2 at prog:22>
3711 o3 <unsigned long o3 at prog:23>
3712 o4 <unsigned long long o4 at prog:24>
3713 o5 <long o5 at prog:25>
3714 o6 <unsigned long o6 at prog:26>
3715 o7 <unsigned long long o7 at prog:27>
3716 s1 <long s1 at prog:16>
3717 s2 <long s2 at prog:17>
3718 u1 <int u1 at prog:1>
3719 u2 <unsigned u2 at prog:2>
3720 u3 <unsigned long u3 at prog:3>
3721 u4 <unsigned long long u4 at prog:4>
3722 u5 <long u5 at prog:5>
3723 u6 <unsigned long u6 at prog:6>
3724 u7 <unsigned long long u7 at prog:7>
3725 x2 <unsigned x2 at prog:37>
3726 x3 <unsigned long x3 at prog:38>
3727 x4 <unsigned long long x4 at prog:39>
3728 x5 <long x5 at prog:40>
3729 x6 <unsigned long x6 at prog:41>
3730 x7 <unsigned long long x7 at prog:42>
3731 _ATEOF
3732
3733 { set +x
3734 printf "%s\n" "$at_srcdir/num.at:17: cflow -i x prog"
3735 at_fn_check_prepare_trace "num.at:17"
3736 ( $at_check_trace; cflow -i x prog
3737 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3738 at_status=$? at_failed=false
3739 $at_check_filter
3740 at_fn_diff_devnull "$at_stderr" || at_failed=:
3741 $at_diff expout "$at_stdout" || at_failed=:
3742 at_fn_check_status 0 $at_status "$at_srcdir/num.at:17"
3743 $at_failed && at_fn_log_failure
3744 $at_traceon; }
3745
3746 set +x
3747 $at_times_p && times >"$at_times_file"
3748 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3749 read at_status <"$at_status_file"
3750 #AT_STOP_23
3751 #AT_START_24
3752 at_fn_group_banner 24 'struct.at:19' \
3753 "struct definition followed by attribute" " " 1
3754 at_xfail=no
3755 (
3756 printf "%s\n" "24. $at_setup_line: testing $at_desc ..."
3757 $at_traceon
3758
3759
3760
3761 cat >prog <<'_ATEOF'
3762 struct bar {
3763 struct foo *dummy;
3764 } __attribute__((aligned(8)));
3765
3766 int
3767 main(int argc, char **argv)
3768 {
3769 }
3770
3771 _ATEOF
3772
3773
3774 cat >expout <<'_ATEOF'
3775 main() <int main (int argc, char **argv) at prog:6>
3776 _ATEOF
3777
3778 { set +x
3779 printf "%s\n" "$at_srcdir/struct.at:19: cflow prog"
3780 at_fn_check_prepare_trace "struct.at:19"
3781 ( $at_check_trace; cflow prog
3782 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3783 at_status=$? at_failed=false
3784 $at_check_filter
3785 at_fn_diff_devnull "$at_stderr" || at_failed=:
3786 $at_diff expout "$at_stdout" || at_failed=:
3787 at_fn_check_status 0 $at_status "$at_srcdir/struct.at:19"
3788 $at_failed && at_fn_log_failure
3789 $at_traceon; }
3790
3791 set +x
3792 $at_times_p && times >"$at_times_file"
3793 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3794 read at_status <"$at_status_file"
3795 #AT_STOP_24
3796 #AT_START_25
3797 at_fn_group_banner 25 'struct.at:33' \
3798 "struct definition followed by wrapper" " " 1
3799 at_xfail=no
3800 (
3801 printf "%s\n" "25. $at_setup_line: testing $at_desc ..."
3802 $at_traceon
3803
3804
3805
3806 cat >prog <<'_ATEOF'
3807 struct bar {
3808 struct foo *dummy;
3809 } __attribute__((aligned(8)));
3810
3811 int
3812 main(int argc, char **argv)
3813 {
3814 }
3815
3816 _ATEOF
3817
3818
3819 cat >expout <<'_ATEOF'
3820 main() <int main (int argc, char **argv) at prog:6>
3821 _ATEOF
3822
3823 { set +x
3824 printf "%s\n" "$at_srcdir/struct.at:33: cflow --symbol __attribute__:wrapper prog"
3825 at_fn_check_prepare_trace "struct.at:33"
3826 ( $at_check_trace; cflow --symbol __attribute__:wrapper prog
3827 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3828 at_status=$? at_failed=false
3829 $at_check_filter
3830 at_fn_diff_devnull "$at_stderr" || at_failed=:
3831 $at_diff expout "$at_stdout" || at_failed=:
3832 at_fn_check_status 0 $at_status "$at_srcdir/struct.at:33"
3833 $at_failed && at_fn_log_failure
3834 $at_traceon; }
3835
3836 set +x
3837 $at_times_p && times >"$at_times_file"
3838 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3839 read at_status <"$at_status_file"
3840 #AT_STOP_25
3841 #AT_START_26
3842 at_fn_group_banner 26 'struct.at:49' \
3843 "ANSI C function returning a struct" " " 1
3844 at_xfail=no
3845 (
3846 printf "%s\n" "26. $at_setup_line: testing $at_desc ..."
3847 $at_traceon
3848
3849
3850
3851 cat >prog <<'_ATEOF'
3852 struct s *
3853 foo(int arg)
3854 {
3855 bar();
3856 }
3857 int
3858 main(int argc, char **argv)
3859 {
3860 foo();
3861 }
3862
3863 _ATEOF
3864
3865
3866 cat >expout <<'_ATEOF'
3867 main() <int main (int argc, char **argv) at prog:7>:
3868 foo() <struct s *foo (int arg) at prog:2>:
3869 bar()
3870 _ATEOF
3871
3872 { set +x
3873 printf "%s\n" "$at_srcdir/struct.at:49: cflow prog"
3874 at_fn_check_prepare_trace "struct.at:49"
3875 ( $at_check_trace; cflow prog
3876 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3877 at_status=$? at_failed=false
3878 $at_check_filter
3879 at_fn_diff_devnull "$at_stderr" || at_failed=:
3880 $at_diff expout "$at_stdout" || at_failed=:
3881 at_fn_check_status 0 $at_status "$at_srcdir/struct.at:49"
3882 $at_failed && at_fn_log_failure
3883 $at_traceon; }
3884
3885 set +x
3886 $at_times_p && times >"$at_times_file"
3887 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3888 read at_status <"$at_status_file"
3889 #AT_STOP_26
3890 #AT_START_27
3891 at_fn_group_banner 27 'struct.at:67' \
3892 "K&R C function returning a struct" " " 1
3893 at_xfail=no
3894 (
3895 printf "%s\n" "27. $at_setup_line: testing $at_desc ..."
3896 $at_traceon
3897
3898
3899
3900 cat >prog <<'_ATEOF'
3901 struct s *
3902 foo(arg)
3903 int arg;
3904 {
3905 bar();
3906 }
3907 int
3908 main(argc, argv)
3909 int argc;
3910 char **argv;
3911 {
3912 foo();
3913 }
3914
3915 _ATEOF
3916
3917
3918 cat >expout <<'_ATEOF'
3919 main() <int main (argc, argv) at prog:8>:
3920 foo() <struct s *foo (arg) at prog:2>:
3921 bar()
3922 _ATEOF
3923
3924 { set +x
3925 printf "%s\n" "$at_srcdir/struct.at:67: cflow prog"
3926 at_fn_check_prepare_trace "struct.at:67"
3927 ( $at_check_trace; cflow prog
3928 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3929 at_status=$? at_failed=false
3930 $at_check_filter
3931 at_fn_diff_devnull "$at_stderr" || at_failed=:
3932 $at_diff expout "$at_stdout" || at_failed=:
3933 at_fn_check_status 0 $at_status "$at_srcdir/struct.at:67"
3934 $at_failed && at_fn_log_failure
3935 $at_traceon; }
3936
3937 set +x
3938 $at_times_p && times >"$at_times_file"
3939 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3940 read at_status <"$at_status_file"
3941 #AT_STOP_27
3942 #AT_START_28
3943 at_fn_group_banner 28 'struct.at:88' \
3944 "struct as argument" " " 1
3945 at_xfail=no
3946 (
3947 printf "%s\n" "28. $at_setup_line: testing $at_desc ..."
3948 $at_traceon
3949
3950
3951
3952 cat >prog <<'_ATEOF'
3953 int
3954 foo(struct bar *x)
3955 {
3956 }
3957
3958 _ATEOF
3959
3960
3961 cat >expout <<'_ATEOF'
3962 foo() <int foo (struct bar *x) at prog:2>
3963 _ATEOF
3964
3965 { set +x
3966 printf "%s\n" "$at_srcdir/struct.at:88: cflow -m foo prog"
3967 at_fn_check_prepare_trace "struct.at:88"
3968 ( $at_check_trace; cflow -m foo prog
3969 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
3970 at_status=$? at_failed=false
3971 $at_check_filter
3972 at_fn_diff_devnull "$at_stderr" || at_failed=:
3973 $at_diff expout "$at_stdout" || at_failed=:
3974 at_fn_check_status 0 $at_status "$at_srcdir/struct.at:88"
3975 $at_failed && at_fn_log_failure
3976 $at_traceon; }
3977
3978 set +x
3979 $at_times_p && times >"$at_times_file"
3980 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
3981 read at_status <"$at_status_file"
3982 #AT_STOP_28
3983 #AT_START_29
3984 at_fn_group_banner 29 'struct.at:100' \
3985 "struct variable" " " 1
3986 at_xfail=no
3987 (
3988 printf "%s\n" "29. $at_setup_line: testing $at_desc ..."
3989 $at_traceon
3990
3991
3992
3993 cat >prog <<'_ATEOF'
3994 struct { int x; int y; } point;
3995
3996 _ATEOF
3997
3998
3999 cat >expout <<'_ATEOF'
4000 point * prog:1 struct { ... } point
4001 _ATEOF
4002
4003 { set +x
4004 printf "%s\n" "$at_srcdir/struct.at:100: cflow -x -ix prog"
4005 at_fn_check_prepare_trace "struct.at:100"
4006 ( $at_check_trace; cflow -x -ix prog
4007 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4008 at_status=$? at_failed=false
4009 $at_check_filter
4010 at_fn_diff_devnull "$at_stderr" || at_failed=:
4011 $at_diff expout "$at_stdout" || at_failed=:
4012 at_fn_check_status 0 $at_status "$at_srcdir/struct.at:100"
4013 $at_failed && at_fn_log_failure
4014 $at_traceon; }
4015
4016 set +x
4017 $at_times_p && times >"$at_times_file"
4018 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4019 read at_status <"$at_status_file"
4020 #AT_STOP_29
4021 #AT_START_30
4022 at_fn_group_banner 30 'struct.at:109' \
4023 "array of structs" " " 1
4024 at_xfail=no
4025 (
4026 printf "%s\n" "30. $at_setup_line: testing $at_desc ..."
4027 $at_traceon
4028
4029
4030
4031 cat >prog <<'_ATEOF'
4032 struct X {
4033 char *name;
4034 } X[] = {
4035 { "foo" },
4036 };
4037
4038 _ATEOF
4039
4040
4041 cat >expout <<'_ATEOF'
4042 X * prog:3 struct X { char *name } X[]
4043 _ATEOF
4044
4045 { set +x
4046 printf "%s\n" "$at_srcdir/struct.at:109: cflow -x -ix prog"
4047 at_fn_check_prepare_trace "struct.at:109"
4048 ( $at_check_trace; cflow -x -ix prog
4049 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4050 at_status=$? at_failed=false
4051 $at_check_filter
4052 at_fn_diff_devnull "$at_stderr" || at_failed=:
4053 $at_diff expout "$at_stdout" || at_failed=:
4054 at_fn_check_status 0 $at_status "$at_srcdir/struct.at:109"
4055 $at_failed && at_fn_log_failure
4056 $at_traceon; }
4057
4058 set +x
4059 $at_times_p && times >"$at_times_file"
4060 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4061 read at_status <"$at_status_file"
4062 #AT_STOP_30
4063 #AT_START_31
4064 at_fn_group_banner 31 'struct.at:122' \
4065 "union in typedefs" " " 1
4066 at_xfail=no
4067 (
4068 printf "%s\n" "31. $at_setup_line: testing $at_desc ..."
4069 $at_traceon
4070
4071
4072
4073 cat >prog <<'_ATEOF'
4074 int foo(int status)
4075 {
4076 /*
4077 * The following construct is a simplified expansion of the
4078 * WTERMSIG macro from glibc.
4079 */
4080 int x = (((((union { unisgned __in; int __i; }) { .__in = (status) }).__i)) & 0x7f);
4081 }
4082 _ATEOF
4083
4084
4085 cat >expout <<'_ATEOF'
4086 foo() <int foo (int status) at prog:1>
4087 _ATEOF
4088
4089 { set +x
4090 printf "%s\n" "$at_srcdir/struct.at:122: cflow prog"
4091 at_fn_check_prepare_trace "struct.at:122"
4092 ( $at_check_trace; cflow prog
4093 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4094 at_status=$? at_failed=false
4095 $at_check_filter
4096 at_fn_diff_devnull "$at_stderr" || at_failed=:
4097 $at_diff expout "$at_stdout" || at_failed=:
4098 at_fn_check_status 0 $at_status "$at_srcdir/struct.at:122"
4099 $at_failed && at_fn_log_failure
4100 $at_traceon; }
4101
4102 set +x
4103 $at_times_p && times >"$at_times_file"
4104 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4105 read at_status <"$at_status_file"
4106 #AT_STOP_31
4107 #AT_START_32
4108 at_fn_group_banner 32 'typedef.at:19' \
4109 "structs with same members" " " 2
4110 at_xfail=no
4111 (
4112 printf "%s\n" "32. $at_setup_line: testing $at_desc ..."
4113 $at_traceon
4114
4115
4116
4117 cat >prog <<'_ATEOF'
4118 typedef struct x {
4119 char **foo;
4120 } X;
4121 typedef struct y {
4122 char **foo;
4123 } Y;
4124
4125 _ATEOF
4126
4127
4128 cat >expout <<'_ATEOF'
4129 X t prog:3
4130 Y t prog:6
4131 _ATEOF
4132
4133 { set +x
4134 printf "%s\n" "$at_srcdir/typedef.at:19: cflow -x -it prog"
4135 at_fn_check_prepare_trace "typedef.at:19"
4136 ( $at_check_trace; cflow -x -it prog
4137 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4138 at_status=$? at_failed=false
4139 $at_check_filter
4140 at_fn_diff_devnull "$at_stderr" || at_failed=:
4141 $at_diff expout "$at_stdout" || at_failed=:
4142 at_fn_check_status 0 $at_status "$at_srcdir/typedef.at:19"
4143 $at_failed && at_fn_log_failure
4144 $at_traceon; }
4145
4146 set +x
4147 $at_times_p && times >"$at_times_file"
4148 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4149 read at_status <"$at_status_file"
4150 #AT_STOP_32
4151 #AT_START_33
4152 at_fn_group_banner 33 'typedef.at:19' \
4153 "structs with tags matching typedef" " " 2
4154 at_xfail=no
4155 (
4156 printf "%s\n" "33. $at_setup_line: testing $at_desc ..."
4157 $at_traceon
4158
4159
4160
4161 cat >prog <<'_ATEOF'
4162 typedef struct X {
4163 char **foo;
4164 } X;
4165 typedef struct Y {
4166 char **foo;
4167 } Y;
4168
4169 _ATEOF
4170
4171
4172 cat >expout <<'_ATEOF'
4173 X t prog:3
4174 Y t prog:6
4175 _ATEOF
4176
4177 { set +x
4178 printf "%s\n" "$at_srcdir/typedef.at:19: cflow -x -it prog"
4179 at_fn_check_prepare_trace "typedef.at:19"
4180 ( $at_check_trace; cflow -x -it prog
4181 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4182 at_status=$? at_failed=false
4183 $at_check_filter
4184 at_fn_diff_devnull "$at_stderr" || at_failed=:
4185 $at_diff expout "$at_stdout" || at_failed=:
4186 at_fn_check_status 0 $at_status "$at_srcdir/typedef.at:19"
4187 $at_failed && at_fn_log_failure
4188 $at_traceon; }
4189
4190 set +x
4191 $at_times_p && times >"$at_times_file"
4192 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4193 read at_status <"$at_status_file"
4194 #AT_STOP_33
4195 #AT_START_34
4196 at_fn_group_banner 34 'typedef.at:19' \
4197 "typedef to pointer" " " 2
4198 at_xfail=no
4199 (
4200 printf "%s\n" "34. $at_setup_line: testing $at_desc ..."
4201 $at_traceon
4202
4203
4204
4205 cat >prog <<'_ATEOF'
4206 typedef struct X {
4207 char **foo;
4208 } **X;
4209
4210 _ATEOF
4211
4212
4213 cat >expout <<'_ATEOF'
4214 X t prog:3
4215 _ATEOF
4216
4217 { set +x
4218 printf "%s\n" "$at_srcdir/typedef.at:19: cflow -x -it prog"
4219 at_fn_check_prepare_trace "typedef.at:19"
4220 ( $at_check_trace; cflow -x -it prog
4221 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4222 at_status=$? at_failed=false
4223 $at_check_filter
4224 at_fn_diff_devnull "$at_stderr" || at_failed=:
4225 $at_diff expout "$at_stdout" || at_failed=:
4226 at_fn_check_status 0 $at_status "$at_srcdir/typedef.at:19"
4227 $at_failed && at_fn_log_failure
4228 $at_traceon; }
4229
4230 set +x
4231 $at_times_p && times >"$at_times_file"
4232 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4233 read at_status <"$at_status_file"
4234 #AT_STOP_34
4235 #AT_START_35
4236 at_fn_group_banner 35 'typedef.at:19' \
4237 "modifiers" " " 2
4238 at_xfail=no
4239 (
4240 printf "%s\n" "35. $at_setup_line: testing $at_desc ..."
4241 $at_traceon
4242
4243
4244
4245 cat >prog <<'_ATEOF'
4246 typedef struct X const *Y;
4247
4248 _ATEOF
4249
4250
4251 cat >expout <<'_ATEOF'
4252 Y t prog:1
4253 _ATEOF
4254
4255 { set +x
4256 printf "%s\n" "$at_srcdir/typedef.at:19: cflow -x -it prog"
4257 at_fn_check_prepare_trace "typedef.at:19"
4258 ( $at_check_trace; cflow -x -it prog
4259 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4260 at_status=$? at_failed=false
4261 $at_check_filter
4262 at_fn_diff_devnull "$at_stderr" || at_failed=:
4263 $at_diff expout "$at_stdout" || at_failed=:
4264 at_fn_check_status 0 $at_status "$at_srcdir/typedef.at:19"
4265 $at_failed && at_fn_log_failure
4266 $at_traceon; }
4267
4268 set +x
4269 $at_times_p && times >"$at_times_file"
4270 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4271 read at_status <"$at_status_file"
4272 #AT_STOP_35
4273 #AT_START_36
4274 at_fn_group_banner 36 'all.at:20' \
4275 "default" " " 3
4276 at_xfail=no
4277 (
4278 printf "%s\n" "36. $at_setup_line: testing $at_desc ..."
4279 $at_traceon
4280
4281
4282
4283 cat >prog <<'_ATEOF'
4284 int
4285 foo(void)
4286 {
4287 baz();
4288 }
4289 int
4290 bar(void)
4291 {
4292 qux();
4293 }
4294 void
4295 qux(void)
4296 {
4297 boom();
4298 }
4299
4300 _ATEOF
4301
4302
4303 cat >expout <<'_ATEOF'
4304 bar() <int bar (void) at prog:7>:
4305 qux() <void qux (void) at prog:12>:
4306 boom()
4307 foo() <int foo (void) at prog:2>:
4308 baz()
4309 _ATEOF
4310
4311 { set +x
4312 printf "%s\n" "$at_srcdir/all.at:20: cflow prog"
4313 at_fn_check_prepare_trace "all.at:20"
4314 ( $at_check_trace; cflow prog
4315 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4316 at_status=$? at_failed=false
4317 $at_check_filter
4318 at_fn_diff_devnull "$at_stderr" || at_failed=:
4319 $at_diff expout "$at_stdout" || at_failed=:
4320 at_fn_check_status 0 $at_status "$at_srcdir/all.at:20"
4321 $at_failed && at_fn_log_failure
4322 $at_traceon; }
4323
4324 set +x
4325 $at_times_p && times >"$at_times_file"
4326 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4327 read at_status <"$at_status_file"
4328 #AT_STOP_36
4329 #AT_START_37
4330 at_fn_group_banner 37 'all.at:47' \
4331 "default (main present)" " " 3
4332 at_xfail=no
4333 (
4334 printf "%s\n" "37. $at_setup_line: testing $at_desc ..."
4335 $at_traceon
4336
4337
4338
4339 cat >prog <<'_ATEOF'
4340 int
4341 foo(void)
4342 {
4343 baz();
4344 }
4345 int
4346 bar(void)
4347 {
4348 qux();
4349 }
4350 void
4351 qux(void)
4352 {
4353 boom();
4354 }
4355 int
4356 main(void)
4357 {
4358 zuuq();
4359 }
4360
4361 _ATEOF
4362
4363
4364 cat >expout <<'_ATEOF'
4365 main() <int main (void) at prog:17>:
4366 zuuq()
4367 _ATEOF
4368
4369 { set +x
4370 printf "%s\n" "$at_srcdir/all.at:47: cflow prog"
4371 at_fn_check_prepare_trace "all.at:47"
4372 ( $at_check_trace; cflow prog
4373 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4374 at_status=$? at_failed=false
4375 $at_check_filter
4376 at_fn_diff_devnull "$at_stderr" || at_failed=:
4377 $at_diff expout "$at_stdout" || at_failed=:
4378 at_fn_check_status 0 $at_status "$at_srcdir/all.at:47"
4379 $at_failed && at_fn_log_failure
4380 $at_traceon; }
4381
4382 set +x
4383 $at_times_p && times >"$at_times_file"
4384 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4385 read at_status <"$at_status_file"
4386 #AT_STOP_37
4387 #AT_START_38
4388 at_fn_group_banner 38 'all.at:76' \
4389 "the --main option" " " 3
4390 at_xfail=no
4391 (
4392 printf "%s\n" "38. $at_setup_line: testing $at_desc ..."
4393 $at_traceon
4394
4395
4396
4397 cat >prog <<'_ATEOF'
4398 int
4399 foo(void)
4400 {
4401 baz();
4402 }
4403 int
4404 bar(void)
4405 {
4406 qux();
4407 }
4408 void
4409 qux(void)
4410 {
4411 boom();
4412 }
4413
4414 _ATEOF
4415
4416
4417 cat >expout <<'_ATEOF'
4418 foo() <int foo (void) at prog:2>:
4419 baz()
4420 _ATEOF
4421
4422 { set +x
4423 printf "%s\n" "$at_srcdir/all.at:76: cflow --main=foo prog"
4424 at_fn_check_prepare_trace "all.at:76"
4425 ( $at_check_trace; cflow --main=foo prog
4426 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4427 at_status=$? at_failed=false
4428 $at_check_filter
4429 at_fn_diff_devnull "$at_stderr" || at_failed=:
4430 $at_diff expout "$at_stdout" || at_failed=:
4431 at_fn_check_status 0 $at_status "$at_srcdir/all.at:76"
4432 $at_failed && at_fn_log_failure
4433 $at_traceon; }
4434
4435 set +x
4436 $at_times_p && times >"$at_times_file"
4437 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4438 read at_status <"$at_status_file"
4439 #AT_STOP_38
4440 #AT_START_39
4441 at_fn_group_banner 39 'all.at:102' \
4442 "the --all option" " " 3
4443 at_xfail=no
4444 (
4445 printf "%s\n" "39. $at_setup_line: testing $at_desc ..."
4446 $at_traceon
4447
4448
4449
4450 cat >prog <<'_ATEOF'
4451 int
4452 foo(void)
4453 {
4454 baz();
4455 }
4456 int
4457 bar(void)
4458 {
4459 qux();
4460 }
4461 void
4462 qux(void)
4463 {
4464 boom();
4465 }
4466
4467 _ATEOF
4468
4469
4470 cat >expout <<'_ATEOF'
4471 bar() <int bar (void) at prog:7>:
4472 qux() <void qux (void) at prog:12>:
4473 boom()
4474 foo() <int foo (void) at prog:2>:
4475 baz()
4476 _ATEOF
4477
4478 { set +x
4479 printf "%s\n" "$at_srcdir/all.at:102: cflow --all prog"
4480 at_fn_check_prepare_trace "all.at:102"
4481 ( $at_check_trace; cflow --all prog
4482 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4483 at_status=$? at_failed=false
4484 $at_check_filter
4485 at_fn_diff_devnull "$at_stderr" || at_failed=:
4486 $at_diff expout "$at_stdout" || at_failed=:
4487 at_fn_check_status 0 $at_status "$at_srcdir/all.at:102"
4488 $at_failed && at_fn_log_failure
4489 $at_traceon; }
4490
4491 set +x
4492 $at_times_p && times >"$at_times_file"
4493 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4494 read at_status <"$at_status_file"
4495 #AT_STOP_39
4496 #AT_START_40
4497 at_fn_group_banner 40 'all.at:131' \
4498 "the --all --all option" " " 3
4499 at_xfail=no
4500 (
4501 printf "%s\n" "40. $at_setup_line: testing $at_desc ..."
4502 $at_traceon
4503
4504
4505
4506 cat >prog <<'_ATEOF'
4507 int
4508 foo(void)
4509 {
4510 baz();
4511 }
4512 int
4513 bar(void)
4514 {
4515 qux();
4516 }
4517 void
4518 qux(void)
4519 {
4520 boom();
4521 }
4522
4523 _ATEOF
4524
4525
4526 cat >expout <<'_ATEOF'
4527 bar() <int bar (void) at prog:7>:
4528 qux() <void qux (void) at prog:12>:
4529 boom()
4530 foo() <int foo (void) at prog:2>:
4531 baz()
4532 qux() <void qux (void) at prog:12>:
4533 boom()
4534 _ATEOF
4535
4536 { set +x
4537 printf "%s\n" "$at_srcdir/all.at:131: cflow --all --all prog"
4538 at_fn_check_prepare_trace "all.at:131"
4539 ( $at_check_trace; cflow --all --all prog
4540 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4541 at_status=$? at_failed=false
4542 $at_check_filter
4543 at_fn_diff_devnull "$at_stderr" || at_failed=:
4544 $at_diff expout "$at_stdout" || at_failed=:
4545 at_fn_check_status 0 $at_status "$at_srcdir/all.at:131"
4546 $at_failed && at_fn_log_failure
4547 $at_traceon; }
4548
4549 set +x
4550 $at_times_p && times >"$at_times_file"
4551 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4552 read at_status <"$at_status_file"
4553 #AT_STOP_40
4554 #AT_START_41
4555 at_fn_group_banner 41 'all.at:162' \
4556 "the --all option with main" " " 3
4557 at_xfail=no
4558 (
4559 printf "%s\n" "41. $at_setup_line: testing $at_desc ..."
4560 $at_traceon
4561
4562
4563
4564 cat >prog <<'_ATEOF'
4565 int
4566 foo(void)
4567 {
4568 baz();
4569 }
4570 int
4571 bar(void)
4572 {
4573 qux();
4574 }
4575 void
4576 qux(void)
4577 {
4578 boom();
4579 }
4580 int
4581 main(void)
4582 {
4583 zuuq();
4584 }
4585
4586 _ATEOF
4587
4588
4589 cat >expout <<'_ATEOF'
4590 main() <int main (void) at prog:17>:
4591 zuuq()
4592 bar() <int bar (void) at prog:7>:
4593 qux() <void qux (void) at prog:12>:
4594 boom()
4595 foo() <int foo (void) at prog:2>:
4596 baz()
4597 _ATEOF
4598
4599 { set +x
4600 printf "%s\n" "$at_srcdir/all.at:162: cflow --all prog"
4601 at_fn_check_prepare_trace "all.at:162"
4602 ( $at_check_trace; cflow --all prog
4603 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4604 at_status=$? at_failed=false
4605 $at_check_filter
4606 at_fn_diff_devnull "$at_stderr" || at_failed=:
4607 $at_diff expout "$at_stdout" || at_failed=:
4608 at_fn_check_status 0 $at_status "$at_srcdir/all.at:162"
4609 $at_failed && at_fn_log_failure
4610 $at_traceon; }
4611
4612 set +x
4613 $at_times_p && times >"$at_times_file"
4614 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4615 read at_status <"$at_status_file"
4616 #AT_STOP_41
4617 #AT_START_42
4618 at_fn_group_banner 42 'all.at:198' \
4619 "the --all --all option with main" " " 3
4620 at_xfail=no
4621 (
4622 printf "%s\n" "42. $at_setup_line: testing $at_desc ..."
4623 $at_traceon
4624
4625
4626
4627 cat >prog <<'_ATEOF'
4628 int
4629 foo(void)
4630 {
4631 baz();
4632 }
4633 int
4634 bar(void)
4635 {
4636 qux();
4637 }
4638 void
4639 qux(void)
4640 {
4641 boom();
4642 }
4643 int
4644 main(void)
4645 {
4646 zuuq();
4647 }
4648
4649 _ATEOF
4650
4651
4652 cat >expout <<'_ATEOF'
4653 main() <int main (void) at prog:17>:
4654 zuuq()
4655 bar() <int bar (void) at prog:7>:
4656 qux() <void qux (void) at prog:12>:
4657 boom()
4658 foo() <int foo (void) at prog:2>:
4659 baz()
4660 qux() <void qux (void) at prog:12>:
4661 boom()
4662 _ATEOF
4663
4664 { set +x
4665 printf "%s\n" "$at_srcdir/all.at:198: cflow --all --all prog"
4666 at_fn_check_prepare_trace "all.at:198"
4667 ( $at_check_trace; cflow --all --all prog
4668 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4669 at_status=$? at_failed=false
4670 $at_check_filter
4671 at_fn_diff_devnull "$at_stderr" || at_failed=:
4672 $at_diff expout "$at_stdout" || at_failed=:
4673 at_fn_check_status 0 $at_status "$at_srcdir/all.at:198"
4674 $at_failed && at_fn_log_failure
4675 $at_traceon; }
4676
4677 set +x
4678 $at_times_p && times >"$at_times_file"
4679 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4680 read at_status <"$at_status_file"
4681 #AT_STOP_42
4682 #AT_START_43
4683 at_fn_group_banner 43 'all.at:236' \
4684 "the --no-main option" " " 3
4685 at_xfail=no
4686 (
4687 printf "%s\n" "43. $at_setup_line: testing $at_desc ..."
4688 $at_traceon
4689
4690
4691
4692 cat >prog <<'_ATEOF'
4693 int
4694 foo(void)
4695 {
4696 baz();
4697 }
4698 int
4699 bar(void)
4700 {
4701 qux();
4702 }
4703 void
4704 qux(void)
4705 {
4706 boom();
4707 }
4708
4709 _ATEOF
4710
4711
4712 cat >expout <<'_ATEOF'
4713 bar() <int bar (void) at prog:7>:
4714 qux() <void qux (void) at prog:12>:
4715 boom()
4716 foo() <int foo (void) at prog:2>:
4717 baz()
4718 _ATEOF
4719
4720 { set +x
4721 printf "%s\n" "$at_srcdir/all.at:236: cflow --no-main prog"
4722 at_fn_check_prepare_trace "all.at:236"
4723 ( $at_check_trace; cflow --no-main prog
4724 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4725 at_status=$? at_failed=false
4726 $at_check_filter
4727 at_fn_diff_devnull "$at_stderr" || at_failed=:
4728 $at_diff expout "$at_stdout" || at_failed=:
4729 at_fn_check_status 0 $at_status "$at_srcdir/all.at:236"
4730 $at_failed && at_fn_log_failure
4731 $at_traceon; }
4732
4733 set +x
4734 $at_times_p && times >"$at_times_file"
4735 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4736 read at_status <"$at_status_file"
4737 #AT_STOP_43
4738 #AT_START_44
4739 at_fn_group_banner 44 'all.at:266' \
4740 "the --no-main option with main" " " 3
4741 at_xfail=no
4742 (
4743 printf "%s\n" "44. $at_setup_line: testing $at_desc ..."
4744 $at_traceon
4745
4746
4747
4748 cat >prog <<'_ATEOF'
4749 int
4750 foo(void)
4751 {
4752 baz();
4753 }
4754 int
4755 bar(void)
4756 {
4757 qux();
4758 }
4759 void
4760 qux(void)
4761 {
4762 boom();
4763 }
4764 int
4765 main(void)
4766 {
4767 zuuq();
4768 }
4769
4770 _ATEOF
4771
4772
4773 cat >expout <<'_ATEOF'
4774 bar() <int bar (void) at prog:7>:
4775 qux() <void qux (void) at prog:12>:
4776 boom()
4777 foo() <int foo (void) at prog:2>:
4778 baz()
4779 main() <int main (void) at prog:17>:
4780 zuuq()
4781 _ATEOF
4782
4783 { set +x
4784 printf "%s\n" "$at_srcdir/all.at:266: cflow --no-main prog"
4785 at_fn_check_prepare_trace "all.at:266"
4786 ( $at_check_trace; cflow --no-main prog
4787 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4788 at_status=$? at_failed=false
4789 $at_check_filter
4790 at_fn_diff_devnull "$at_stderr" || at_failed=:
4791 $at_diff expout "$at_stdout" || at_failed=:
4792 at_fn_check_status 0 $at_status "$at_srcdir/all.at:266"
4793 $at_failed && at_fn_log_failure
4794 $at_traceon; }
4795
4796 set +x
4797 $at_times_p && times >"$at_times_file"
4798 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4799 read at_status <"$at_status_file"
4800 #AT_STOP_44
4801 #AT_START_45
4802 at_fn_group_banner 45 'corner.at:19' \
4803 "empty expression and closing brace" " " 4
4804 at_xfail=no
4805 (
4806 printf "%s\n" "45. $at_setup_line: testing $at_desc ..."
4807 $at_traceon
4808
4809
4810
4811 cat >prog <<'_ATEOF'
4812 x = }
4813 _ATEOF
4814
4815
4816 : >expout
4817 { set +x
4818 printf "%s\n" "$at_srcdir/corner.at:19: cflow -v prog"
4819 at_fn_check_prepare_trace "corner.at:19"
4820 ( $at_check_trace; cflow -v prog
4821 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4822 at_status=$? at_failed=false
4823 $at_check_filter
4824 echo >>"$at_stderr"; printf "%s\n" "prog:1: expected expression near \`}'
4825 " | \
4826 $at_diff - "$at_stderr" || at_failed=:
4827 $at_diff expout "$at_stdout" || at_failed=:
4828 at_fn_check_status 0 $at_status "$at_srcdir/corner.at:19"
4829 $at_failed && at_fn_log_failure
4830 $at_traceon; }
4831
4832 set +x
4833 $at_times_p && times >"$at_times_file"
4834 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4835 read at_status <"$at_status_file"
4836 #AT_STOP_45
4837 #AT_START_46
4838 at_fn_group_banner 46 'corner.at:28' \
4839 "duplicate typedef" " " 4
4840 at_xfail=no
4841 (
4842 printf "%s\n" "46. $at_setup_line: testing $at_desc ..."
4843 $at_traceon
4844
4845
4846
4847 cat >prog <<'_ATEOF'
4848 typedef struct X X;
4849 typedef struct X { int i; } X;
4850
4851 _ATEOF
4852
4853
4854 cat >expout <<'_ATEOF'
4855 X t prog:2
4856 _ATEOF
4857
4858 { set +x
4859 printf "%s\n" "$at_srcdir/corner.at:28: cflow -it -x prog"
4860 at_fn_check_prepare_trace "corner.at:28"
4861 ( $at_check_trace; cflow -it -x prog
4862 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
4863 at_status=$? at_failed=false
4864 $at_check_filter
4865 at_fn_diff_devnull "$at_stderr" || at_failed=:
4866 $at_diff expout "$at_stdout" || at_failed=:
4867 at_fn_check_status 0 $at_status "$at_srcdir/corner.at:28"
4868 $at_failed && at_fn_log_failure
4869 $at_traceon; }
4870
4871 set +x
4872 $at_times_p && times >"$at_times_file"
4873 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
4874 read at_status <"$at_status_file"
4875 #AT_STOP_46