summaryrefslogtreecommitdiff
path: root/test/dlopen/libstatic.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-02-16 21:35:21 +0000
committerMike Frysinger <vapier@gentoo.org>2007-02-16 21:35:21 +0000
commit9da4b6afffd849f85c4892a2016c899358db99af (patch)
treeba19b50b6e9bf22755a042d22cbacb4d68c45b41 /test/dlopen/libstatic.c
parent138adeccbd94db291a2c2010a941e70cba294a2a (diff)
make sure static variables are re-initialized everytime
Diffstat (limited to 'test/dlopen/libstatic.c')
-rw-r--r--test/dlopen/libstatic.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/dlopen/libstatic.c b/test/dlopen/libstatic.c
new file mode 100644
index 000000000..bf44c3c68
--- /dev/null
+++ b/test/dlopen/libstatic.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+static int global_static = -1;
+
+int static_test(void)
+{
+ static int local_static = -2;
+
+ if (global_static != -1)
+ printf("FAIL: global_static is not -1\n");
+ if (local_static != -2)
+ printf("FAIL: local_static is not -2\n");
+
+ return (global_static == -1 && local_static == -2);
+}