[compiler-rt] r232809 - [ASan] Move a couple of Posix-specific tests to Posix/

Alexander Potapenko glider at google.com
Fri Mar 20 06:42:12 PDT 2015


Author: glider
Date: Fri Mar 20 08:42:11 2015
New Revision: 232809

URL: http://llvm.org/viewvc/llvm-project?rev=232809&view=rev
Log:
[ASan] Move a couple of Posix-specific tests to Posix/
Add a comment about potential breakage of coverage-maybe-open-file.cc on Win

Added:
    compiler-rt/trunk/test/asan/TestCases/Posix/coverage-fork.cc
      - copied unchanged from r232808, compiler-rt/trunk/test/asan/TestCases/coverage-fork.cc
    compiler-rt/trunk/test/asan/TestCases/Posix/log_path_fork_test.cc.disabled
      - copied unchanged from r232800, compiler-rt/trunk/test/asan/TestCases/log_path_fork_test.cc.disabled
Removed:
    compiler-rt/trunk/test/asan/TestCases/coverage-fork.cc
    compiler-rt/trunk/test/asan/TestCases/log_path_fork_test.cc.disabled
Modified:
    compiler-rt/trunk/test/asan/TestCases/coverage-maybe-open-file.cc

Removed: compiler-rt/trunk/test/asan/TestCases/coverage-fork.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/coverage-fork.cc?rev=232808&view=auto
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/coverage-fork.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/coverage-fork.cc (removed)
@@ -1,38 +0,0 @@
-// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t
-// RUN: export ASAN_OPTIONS=coverage=1:coverage_direct=0:verbosity=1
-// RUN: rm -rf %T/coverage-fork
-// RUN: mkdir -p %T/coverage-fork && cd %T/coverage-fork
-// RUN: %run %t 2>&1 | FileCheck %s
-//
-// XFAIL: android
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-__attribute__((noinline))
-void foo() { printf("foo\n"); }
-
-__attribute__((noinline))
-void bar() { printf("bar\n"); }
-
-__attribute__((noinline))
-void baz() { printf("baz\n"); }
-
-int main(int argc, char **argv) {
-  pid_t child_pid = fork();
-  if (child_pid == 0) {
-    fprintf(stderr, "Child PID: %d\n", getpid());
-    baz();
-  } else {
-    fprintf(stderr, "Parent PID: %d\n", getpid());
-    foo();
-    bar();
-  }
-  return 0;
-}
-
-// CHECK-DAG: Child PID: [[ChildPID:[0-9]+]]
-// CHECK-DAG: [[ChildPID]].sancov: 1 PCs written
-// CHECK-DAG: Parent PID: [[ParentPID:[0-9]+]]
-// CHECK-DAG: [[ParentPID]].sancov: 3 PCs written

Modified: compiler-rt/trunk/test/asan/TestCases/coverage-maybe-open-file.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/coverage-maybe-open-file.cc?rev=232809&r1=232808&r2=232809&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/coverage-maybe-open-file.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/coverage-maybe-open-file.cc Fri Mar 20 08:42:11 2015
@@ -15,6 +15,7 @@
 
 #include <sanitizer/coverage_interface.h>
 
+// FIXME: the code below might not work on Windows.
 int main(int argc, char **argv) {
   int fd = __sanitizer_maybe_open_cov_file("test");
   if (fd > 0) {

Removed: compiler-rt/trunk/test/asan/TestCases/log_path_fork_test.cc.disabled
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/log_path_fork_test.cc.disabled?rev=232808&view=auto
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/log_path_fork_test.cc.disabled (original)
+++ compiler-rt/trunk/test/asan/TestCases/log_path_fork_test.cc.disabled (removed)
@@ -1,22 +0,0 @@
-// RUN: %clangxx_asan  %s -o %t
-// RUN: rm -f %t.log.*
-// Set verbosity to 1 so that the log files are opened prior to fork().
-// RUN: env ASAN_OPTIONS="log_path=%t.log verbosity=1" not %run %t 2> %t.out
-// RUN: for f in %t.log.* ; do FileCheck %s < $f; done
-// RUN: [ `ls %t.log.* | wc -l` == 2 ]
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-int main(int argc, char **argv) {
-  void *x = malloc(10);
-  free(x);
-  if (fork() == -1) return 1;
-  // There are two processes at this point, thus there should be two distinct
-  // error logs.
-  free(x);
-  return 0;
-}
-
-// CHECK: ERROR: AddressSanitizer





More information about the llvm-commits mailing list