[compiler-rt] r306940 - [asan] Fix test on Android i686/fugu
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 30 20:54:19 PDT 2017
Author: vitalybuka
Date: Fri Jun 30 20:54:19 2017
New Revision: 306940
URL: http://llvm.org/viewvc/llvm-project?rev=306940&view=rev
Log:
[asan] Fix test on Android i686/fugu
printf from .preinit_array may crash.
Modified:
compiler-rt/trunk/test/asan/TestCases/Linux/init_fini_sections.cc
Modified: compiler-rt/trunk/test/asan/TestCases/Linux/init_fini_sections.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/init_fini_sections.cc?rev=306940&r1=306939&r2=306940&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/init_fini_sections.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/init_fini_sections.cc Fri Jun 30 20:54:19 2017
@@ -2,11 +2,18 @@
#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
More information about the llvm-commits
mailing list