From 9da4b6afffd849f85c4892a2016c899358db99af Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 16 Feb 2007 21:35:21 +0000 Subject: make sure static variables are re-initialized everytime --- test/dlopen/libstatic.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/dlopen/libstatic.c (limited to 'test/dlopen/libstatic.c') 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 + +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); +} -- cgit v1.2.3