<commit_before>// Test various levels of coverage
//
// RUN: %clangxx_msan -DINIT_VAR=1 -O1 -fsanitize-coverage=1  %s -o %t
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
// RUN: %clangxx_msan -O1 -fsanitize-coverage=1  %s -o %t
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN
// RUN: %clangxx_msan -O1 -fsanitize-coverage=2  %s -o %t
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN
// RUN: %clangxx_msan -O1 -fsanitize-coverage=3  %s -o %t
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
//
volatile int sink;
int main(int argc, char **argv) {
  int var;
#if INIT_VAR
  var = 0;
#endif
  if (argc == 0)
    sink = 0;
  return *(volatile int*)&var;
}

// CHECK_WARN: WARNING: MemorySanitizer: use-of-uninitialized-value
// CHECK_NOWARN-NOT: ERROR
// CHECK1:  1 PCs written
// CHECK2:  2 PCs written
// CHECK3:  3 PCs written<commit_msg>[msan] Put the coverage files for coverage-levels.cc into a temporary dir.<commit_after>// Test various levels of coverage
//
// RUN: %clangxx_msan -DINIT_VAR=1 -O1 -fsanitize-coverage=1  %s -o %t
// RUN: mkdir -p %T/coverage-levels
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
// RUN: %clangxx_msan -O1 -fsanitize-coverage=1  %s -o %t
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN
// RUN: %clangxx_msan -O1 -fsanitize-coverage=2  %s -o %t
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN
// RUN: %clangxx_msan -O1 -fsanitize-coverage=3  %s -o %t
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
//
volatile int sink;
int main(int argc, char **argv) {
  int var;
#if INIT_VAR
  var = 0;
#endif
  if (argc == 0)
    sink = 0;
  return *(volatile int*)&var;
}

// CHECK_WARN: WARNING: MemorySanitizer: use-of-uninitialized-value
// CHECK_NOWARN-NOT: ERROR
// CHECK1:  1 PCs written
// CHECK2:  2 PCs written
// CHECK3:  3 PCs written
{'fraction_non_alphanumeric': 0.16060727127447064, 'fraction_numerical': 0.030363563723531762, 'mean_word_length': 3.9880478087649402, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2462221', 'n_tokens_mistral': 1042, 'n_tokens_neox': 1007, 'n_words': 243}