summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-01-31 15:33:37 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-01-31 15:33:37 +0000
commit2afcaf7ec9ae9192e8774dd69bcd5aed32aec69e (patch)
treebf1fc3db72d8133c9dfda757e565c2d530c1921c /regress
parentd14bb2746817e2a70874816ec6cf2f8486d1bcf6 (diff)
simple test for static constructors.
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/csu/ctors/Makefile4
-rw-r--r--regress/lib/csu/ctors/ctors.c19
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;
+}