aboutsummaryrefslogtreecommitdiff
path: root/test/sanitizer_common
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-03 15:21:00 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-03 15:21:00 +0000
commit25091d6bd042c6bf2709eaab2bd1a88f3f2d9fda (patch)
tree55100adfb3ecde3bca3a6aea64f3899b6d46a1c8 /test/sanitizer_common
parent06eabdc027f984611832945782f7c36800d0d397 (diff)
downloadsrc-25091d6bd042c6bf2709eaab2bd1a88f3f2d9fda.tar.gz
src-25091d6bd042c6bf2709eaab2bd1a88f3f2d9fda.zip
Vendor import of compiler-rt trunk r304659:vendor/compiler-rt/compiler-rt-trunk-r304659
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=319527 svn path=/vendor/compiler-rt/compiler-rt-trunk-r304659/; revision=319528; tag=vendor/compiler-rt/compiler-rt-trunk-r304659
Diffstat (limited to 'test/sanitizer_common')
-rw-r--r--test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc b/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc
new file mode 100644
index 000000000000..b7246ebf2751
--- /dev/null
+++ b/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc
@@ -0,0 +1,23 @@
+// Tests -fsanitize-coverage=inline-8bit-counters
+//
+// REQUIRES: has_sancovcc,stable-runtime
+// UNSUPPORTED: i386-darwin
+//
+// RUN: %clangxx -O0 %s -fsanitize-coverage=inline-8bit-counters 2>&1
+
+#include <stdio.h>
+#include <assert.h>
+
+const char *first_counter;
+
+extern "C"
+void __sanitizer_cov_8bit_counters_init(const char *start, const char *end) {
+ printf("INIT: %p %p\n", start, end);
+ assert(end - start > 1);
+ first_counter = start;
+}
+
+int main() {
+ assert(first_counter);
+ assert(*first_counter == 1);
+}