[PATCH] Add FreeBSD support to the address sanitizer's deep_call_stack.cc test case

Viktor Kutuzov vkutuzov at accesssoftek.com
Thu Jul 17 07:43:34 PDT 2014


Hi kcc, samsonov,

http://reviews.llvm.org/D4562

Files:
  test/asan/TestCases/deep_call_stack.cc

Index: test/asan/TestCases/deep_call_stack.cc
===================================================================
--- test/asan/TestCases/deep_call_stack.cc
+++ test/asan/TestCases/deep_call_stack.cc
@@ -1,9 +1,10 @@
 // Check that UAR mode can handle very deep recusrion.
 // export ASAN_OPTIONS=detect_stack_use_after_return=1
 // RUN: %clangxx_asan -O2 %s -o %t && \
-// RUN:   %run %t 2>&1 | FileCheck %s
+// RUN:   %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os
 // Also check that use_sigaltstack+verbosity doesn't crash.
-// RUN: env ASAN_OPTIONS=verbosity=1:use_sigaltstack=1 %run %t  | FileCheck %s
+// RUN: env ASAN_OPTIONS=verbosity=1:use_sigaltstack=1 %run %t | \
+// RUN:   FileCheck %s --check-prefix=CHECK-%os
 #include <stdio.h>
 
 __attribute__((noinline))
@@ -17,9 +18,22 @@
 }
 
 int main(int argc, char **argv) {
+// On FreeBSD the stack size is about 500MB by default and even less in
+// 32-bit mode.
+#if defined(__FreeBSD__)
+  RecursiveFunc(15000, 0);
+#else
   RecursiveFunc(40000, 0);
+#endif
   return 0;
 }
-// CHECK: [40000] ptr:
-// CHECK: [20000] ptr:
-// CHECK: [00000] ptr
+// CHECK-Linux: [40000] ptr:
+// CHECK-Linux: [20000] ptr:
+// CHECK-Linux: [00000] ptr:
+
+// CHECK-FreeBSD: [15000] ptr:
+// CHECK-FreeBSD: [00000] ptr:
+
+// CHECK-Darwin: [40000] ptr:
+// CHECK-Darwin: [20000] ptr:
+// CHECK-Darwin: [00000] ptr:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4562.11579.patch
Type: text/x-patch
Size: 1364 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140717/0d1a19d4/attachment.bin>


More information about the llvm-commits mailing list