xref: /openbsd-src/regress/lib/csu/ctors/ctors.c (revision db3296cf5c1dd9058ceecc3a29fe4aaa0bd26000)
1 /*	$OpenBSD: ctors.c,v 1.3 2003/07/31 21:48:02 deraadt Exp $	*/
2 /*
3  *	Written by Artur Grabowski <art@openbsd.org>, 2002 Public Domain.
4  */
5 void foo(void) __attribute__((constructor));
6 
7 int constructed = 0;
8 
9 void
foo(void)10 foo(void)
11 {
12 	constructed = 1;
13 }
14 
15 int
main(int argc,char * argv[])16 main(int argc, char *argv[])
17 {
18 	return !constructed;
19 }
20