Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit b88c71e

Browse files
committed
[sanitizer-coverage] test for -fsanitize-coverage=inline-8bit-counters
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304632 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 8c2855d commit b88c71e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Tests -fsanitize-coverage=inline-8bit-counters
2+
//
3+
// REQUIRES: has_sancovcc,stable-runtime
4+
// UNSUPPORTED: i386-darwin
5+
//
6+
// RUN: %clangxx -O0 %s -fsanitize-coverage=inline-8bit-counters 2>&1
7+
8+
#include <stdio.h>
9+
#include <assert.h>
10+
11+
const char *first_counter;
12+
13+
extern "C"
14+
void __sanitizer_cov_8bit_counters_init(const char *start, const char *end) {
15+
printf("INIT: %p %p\n", start, end);
16+
assert(end - start > 1);
17+
first_counter = start;
18+
}
19+
20+
int main() {
21+
assert(first_counter);
22+
assert(*first_counter == 1);
23+
}

0 commit comments

Comments
 (0)