diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/lib/csu/ctors/Makefile | 4 | ||||
-rw-r--r-- | regress/lib/csu/ctors/ctors.c | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/regress/lib/csu/ctors/Makefile b/regress/lib/csu/ctors/Makefile new file mode 100644 index 00000000000..69f1b2cf3ed --- /dev/null +++ b/regress/lib/csu/ctors/Makefile @@ -0,0 +1,4 @@ +# $OpenBSD: Makefile,v 1.1 2002/01/31 15:33:36 art Exp $ +PROG=ctors + +.include <bsd.regress.mk> diff --git a/regress/lib/csu/ctors/ctors.c b/regress/lib/csu/ctors/ctors.c new file mode 100644 index 00000000000..ba97bdc6d5f --- /dev/null +++ b/regress/lib/csu/ctors/ctors.c @@ -0,0 +1,19 @@ +/* $OpenBSD: ctors.c,v 1.1 2002/01/31 15:33:36 art Exp $ */ +/* + * Written by Artur Grabowski <art@openbsd.org>. Public Domain. + */ +void foo(void) __attribute__((constructor)); + +int constructed = 0; + +void +foo(void) +{ + constructed = 1; +} + +int +main() +{ + return !constructed; +} |