OSDN Git Service

original
[gb-231r1-is01/GB_2.3_IS01.git] / system / extras / tests / bionic / libc / bionic / lib_static_init.cpp
diff --git a/system/extras/tests/bionic/libc/bionic/lib_static_init.cpp b/system/extras/tests/bionic/libc/bionic/lib_static_init.cpp
new file mode 100644 (file)
index 0000000..d847110
--- /dev/null
@@ -0,0 +1,18 @@
+#include "lib_static_init.h"
+#include <stdio.h>
+
+Foo::Foo()
+{
+    /* increment the static variable */
+    value = ++Foo::counter;
+    fprintf(stderr, "Foo::Foo for this=%p called (counter = %d)\n", this, counter);
+}
+
+int Foo::getValue()
+{
+    return value;
+}
+
+int Foo::counter;
+
+Foo  theFoo;