malloca: Silence a warning from clang's memory sanitizer.
[gnulib.git] / tests / test-atexit.sh
blob643a72f546cb80b5084e593fecd9244a77add6af
1 #!/bin/sh
2 : ${srcdir=.}
3 . "$srcdir/init.sh"; path_prepend_ .
5 # Check that an atexit handler is called when main() returns normally.
6 echo > t-atexit.tmp
7 test-atexit
8 if test -f t-atexit.tmp; then
9 Exit 1
12 # Check that an atexit handler is called when the program is left
13 # through exit(0).
14 echo > t-atexit.tmp
15 test-atexit 0
16 if test -f t-atexit.tmp; then
17 Exit 1
20 # Check that an atexit handler is called when the program is left
21 # through exit(1).
22 echo > t-atexit.tmp
23 test-atexit 1
24 if test -f t-atexit.tmp; then
25 Exit 1
28 Exit 0