[asan] Fix test on Android i686/fugu
printf from .preinit_array may crash.
#include <stdio.h>
+int c = 0;
+
static void foo() {
- printf("foo\n");
+ ++c;
+}
+
+static void fini() {
+ printf("fini\n");
}
int main() {
+ printf("c=%d\n", c);
return 0;
}
@@ -17,8 +24,7 @@ __attribute__((section(".init_array")))
void (*call_foo_2)(void) = &foo;
__attribute__((section(".fini_array")))
-void (*call_foo_3)(void) = &foo;
+void (*call_foo_3)(void) = &fini;
-// CHECK: foo
-// CHECK: foo
-// CHECK: foo
+// CHECK: c=2
+// CHECK: fini
