[PATCH] Test failures in GCC ASan testsuite on ARM Linux due to FP format mismatch between libsanitizer and GCC.

Yury Gribov tetra2005 at gmail.com
Tue Jul 29 01:30:47 PDT 2014


================
Comment at: test/asan/TestCases/Linux/clang_gcc_abi.cc:4
@@ +3,3 @@
+// RUN: %clangxx_asan -O2 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s
+
----------------
Do we really need to check all optimization levels?

================
Comment at: test/asan/TestCases/Linux/clang_gcc_abi.cc:10
@@ +9,3 @@
+
+volatile int three = 3;
+int boom() {
----------------
Perhaps make this local?

================
Comment at: test/asan/TestCases/Linux/clang_gcc_abi.cc:13
@@ +12,3 @@
+  char *s = (char *)malloc(three);
+  return s[three]; //BOOM
+}
----------------
Contents of s is undefined so compiler could optimize this access out.

================
Comment at: test/asan/TestCases/Linux/clang_gcc_abi.cc:17
@@ +16,3 @@
+__attribute__((naked, noinline)) void gcc_abi() {
+  asm("str fp, [sp, #-8]!\n\t"
+      "str lr, [sp, #4]\n\t"
----------------
I think this should better be asm volatile.

================
Comment at: test/asan/TestCases/Linux/clang_gcc_abi.cc:29
@@ +28,3 @@
+__attribute__((naked, noinline)) void clang_abi() {
+  asm("push    {r11, lr}\n\t"
+      "mov r11, sp\n\t"
----------------
Likewise.

http://reviews.llvm.org/D4692






More information about the llvm-commits mailing list