[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / sanitizer_coverage_inline_bool_flag.cpp
blobd62ffe613b5b03c3942ec268c48c4b10aa986428
1 // Tests -fsanitize-coverage=inline-bool-flag,pc-table
2 //
3 // REQUIRES: has_sancovcc,stable-runtime
4 // UNSUPPORTED: i386-darwin, x86_64-darwin
5 //
6 // RUN: %clangxx -O0 %s -fsanitize-coverage=inline-bool-flag,pc-table -o %t
7 // RUN: %run %t 2>&1 | FileCheck %s
9 #include <assert.h>
10 #include <stdint.h>
11 #include <stdio.h>
13 const bool *first_flag;
15 extern "C" void __sanitizer_cov_bool_flag_init(const bool *start,
16 const bool *end) {
17 printf("INIT: %p %p\n", start, end);
18 assert(end - start > 1);
19 first_flag = start;
22 uintptr_t FirstPC;
23 uintptr_t FirstPCFlag;
25 extern "C" void __sanitizer_cov_pcs_init(const uintptr_t *pcs_beg,
26 const uintptr_t *pcs_end) {
27 const uintptr_t *B = (const uintptr_t *)pcs_beg;
28 const uintptr_t *E = (const uintptr_t *)pcs_end;
29 assert(B + 1 < E);
30 FirstPC = B[0];
31 FirstPCFlag = B[1];
34 int main() {
35 assert(first_flag);
36 assert(*first_flag);
37 assert(FirstPC == (uintptr_t)&main);
38 assert(FirstPCFlag == 1);
39 fprintf(stderr, "PASS\n");
40 // CHECK: PASS