From: Evgeniy Stepanov Date: Fri, 14 Feb 2014 14:36:42 +0000 (+0000) Subject: [asan] Change stack uar test to not use ulimit. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44f5d8a49f79f9a8b3462d9b36f472ef290309bc;p=platform%2Fupstream%2Fllvm.git [asan] Change stack uar test to not use ulimit. Because of how Android test runner is implemented, ulimit in RUN: line gets executed on the host machine and does not affect the test. llvm-svn: 201415 --- diff --git a/compiler-rt/test/asan/TestCases/stack-use-after-return.cc b/compiler-rt/test/asan/TestCases/stack-use-after-return.cc index 75313d4..dc38be9 100644 --- a/compiler-rt/test/asan/TestCases/stack-use-after-return.cc +++ b/compiler-rt/test/asan/TestCases/stack-use-after-return.cc @@ -9,8 +9,8 @@ // RUN: not %t 2>&1 | FileCheck %s // RUN: ASAN_OPTIONS=detect_stack_use_after_return=0 %t // Regression test for a CHECK failure with small stack size and large frame. -// RUN: %clangxx_asan -O3 %s -o %t -DkSize=10000 && \ -// RUN: (ulimit -s 65; not %t) 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -o %t -DkSize=10000 -DUseThread -DkStackSize=65536 && \ +// RUN: not %t 2>&1 | FileCheck --check-prefix=THREAD %s // // Test that we can find UAR in a thread other than main: // RUN: %clangxx_asan -DUseThread -O2 %s -o %t && \ @@ -32,6 +32,10 @@ # define UseThread 0 #endif +#ifndef kStackSize +# define kStackSize 0 +#endif + __attribute__((noinline)) char *Ident(char *x) { fprintf(stderr, "1: %p\n", x); @@ -67,8 +71,13 @@ void *Thread(void *unused) { int main(int argc, char **argv) { #if UseThread + pthread_attr_t attr; + pthread_attr_init(&attr); + if (kStackSize > 0) + pthread_attr_setstacksize(&attr, kStackSize); pthread_t t; - pthread_create(&t, 0, Thread, 0); + pthread_create(&t, &attr, Thread, 0); + pthread_attr_destroy(&attr); pthread_join(t, 0); #else Func2(Func1());