summaryrefslogtreecommitdiff
path: root/elf/tst-dlmopen1mod.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-10-27 21:39:59 +0000
committerJakub Jelinek <jakub@redhat.com>2004-10-27 21:39:59 +0000
commit0b5cfa4e0b7c9dc2cd81635307613c86c0f5e200 (patch)
treed9bf37b1a193cb3a52c598349d33c61c00a6aeca /elf/tst-dlmopen1mod.c
parentaa85b49673c934c0eeeec9e6e302f94fa1b165ab (diff)
Diffstat (limited to 'elf/tst-dlmopen1mod.c')
-rw-r--r--elf/tst-dlmopen1mod.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/elf/tst-dlmopen1mod.c b/elf/tst-dlmopen1mod.c
index 40a4c8fa44..142488098a 100644
--- a/elf/tst-dlmopen1mod.c
+++ b/elf/tst-dlmopen1mod.c
@@ -3,6 +3,16 @@
#include <gnu/lib-names.h>
+static int cnt;
+
+static void
+__attribute ((constructor))
+constr (void)
+{
+ ++cnt;
+}
+
+
int
foo (Lmid_t ns2)
{
@@ -34,5 +44,16 @@ foo (Lmid_t ns2)
return 1;
}
+ if (cnt == 0)
+ {
+ puts ("constructor did not run");
+ return 1;
+ }
+ else if (cnt != 1)
+ {
+ puts ("constructor did not run exactly once");
+ return 1;
+ }
+
return 0;
}