[compiler-rt] r246742 - [asan] Split a test in two.
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 2 18:26:31 PDT 2015
Author: eugenis
Date: Wed Sep 2 20:26:30 2015
New Revision: 246742
URL: http://llvm.org/viewvc/llvm-project?rev=246742&view=rev
Log:
[asan] Split a test in two.
wait3 is gone in android-21. Move it out of the common
(wait/waitpid/wait3) test, and mark as unsupported on Android.
Added:
compiler-rt/trunk/test/asan/TestCases/Posix/wait3.cc
- copied, changed from r246741, compiler-rt/trunk/test/asan/TestCases/Posix/wait.cc
Modified:
compiler-rt/trunk/test/asan/TestCases/Posix/wait.cc
Modified: compiler-rt/trunk/test/asan/TestCases/Posix/wait.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Posix/wait.cc?rev=246742&r1=246741&r2=246742&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Posix/wait.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Posix/wait.cc Wed Sep 2 20:26:30 2015
@@ -4,12 +4,6 @@
// RUN: %clangxx_asan -DWAITPID -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -DWAITPID -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -DWAIT3 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -DWAIT3 -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
-
-// RUN: %clangxx_asan -DWAIT3_RUSAGE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -DWAIT3_RUSAGE -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
-
#include <assert.h>
#include <sys/wait.h>
@@ -25,12 +19,6 @@ int main(int argc, char **argv) {
res = wait(status);
#elif defined(WAITPID)
res = waitpid(pid, status, WNOHANG);
-#elif defined(WAIT3)
- res = wait3(status, WNOHANG, NULL);
-#elif defined(WAIT3_RUSAGE)
- struct rusage *ru = (struct rusage*)(x + argc * 3);
- int good_status;
- res = wait3(&good_status, WNOHANG, ru);
#endif
// CHECK: stack-buffer-overflow
// CHECK: {{WRITE of size .* at 0x.* thread T0}}
Copied: compiler-rt/trunk/test/asan/TestCases/Posix/wait3.cc (from r246741, compiler-rt/trunk/test/asan/TestCases/Posix/wait.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Posix/wait3.cc?p2=compiler-rt/trunk/test/asan/TestCases/Posix/wait3.cc&p1=compiler-rt/trunk/test/asan/TestCases/Posix/wait.cc&r1=246741&r2=246742&rev=246742&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Posix/wait.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Posix/wait3.cc Wed Sep 2 20:26:30 2015
@@ -1,15 +1,10 @@
-// RUN: %clangxx_asan -DWAIT -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -DWAIT -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
-
-// RUN: %clangxx_asan -DWAITPID -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -DWAITPID -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
-
// RUN: %clangxx_asan -DWAIT3 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -DWAIT3 -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -DWAIT3_RUSAGE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -DWAIT3_RUSAGE -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: android
#include <assert.h>
#include <sys/wait.h>
@@ -21,11 +16,7 @@ int main(int argc, char **argv) {
int x[3];
int *status = x + argc * 3;
int res;
-#if defined(WAIT)
- res = wait(status);
-#elif defined(WAITPID)
- res = waitpid(pid, status, WNOHANG);
-#elif defined(WAIT3)
+#if defined(WAIT3)
res = wait3(status, WNOHANG, NULL);
#elif defined(WAIT3_RUSAGE)
struct rusage *ru = (struct rusage*)(x + argc * 3);
@@ -35,7 +26,7 @@ int main(int argc, char **argv) {
// CHECK: stack-buffer-overflow
// CHECK: {{WRITE of size .* at 0x.* thread T0}}
// CHECK: {{in .*wait}}
- // CHECK: {{in main .*wait.cc:}}
+ // CHECK: {{in main .*wait3.cc:}}
// CHECK: is located in stack of thread T0 at offset
// CHECK: {{in main}}
return res == -1 ? 1 : 0;
More information about the llvm-commits
mailing list