[compiler-rt] r234496 - [ASan/Win] Add a test that makes sure coverage works at least in the simple cases

Timur Iskhodzhanov timurrrr at google.com
Thu Apr 9 08:58:38 PDT 2015


Author: timurrrr
Date: Thu Apr  9 10:58:38 2015
New Revision: 234496

URL: http://llvm.org/viewvc/llvm-project?rev=234496&view=rev
Log:
[ASan/Win] Add a test that makes sure coverage works at least in the simple cases

Added:
    compiler-rt/trunk/test/asan/TestCases/Windows/coverage-basic.cc

Added: compiler-rt/trunk/test/asan/TestCases/Windows/coverage-basic.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/coverage-basic.cc?rev=234496&view=auto
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Windows/coverage-basic.cc (added)
+++ compiler-rt/trunk/test/asan/TestCases/Windows/coverage-basic.cc Thu Apr  9 10:58:38 2015
@@ -0,0 +1,25 @@
+// RUN: rm -rf %T/coverage-basic
+// RUN: mkdir %T/coverage-basic && cd %T/coverage-basic
+// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o test.exe
+// RUN: env ASAN_OPTIONS=coverage=1 %run test.exe
+//
+// RUN: %sancov print *.sancov | FileCheck %s
+#include <stdio.h>
+
+void foo() { fprintf(stderr, "FOO\n"); }
+void bar() { fprintf(stderr, "BAR\n"); }
+
+int main(int argc, char **argv) {
+  if (argc == 2) {
+    foo();
+    bar();
+  } else {
+    bar();
+    foo();
+  }
+}
+
+// CHECK: 0x{{[0-9a-f]*}}
+// CHECK: 0x{{[0-9a-f]*}}
+// CHECK: 0x{{[0-9a-f]*}}
+// CHECK-NOT: 0x{{[0-9a-f]*}}





More information about the llvm-commits mailing list