<commit_before>// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s

// UNSUPPORTED: solaris

#include <stdio.h>

void print_something() {
  for (size_t i = 0; i < 10 * BUFSIZ; i++)
    printf("Hello world %zu\n", i);
}

// setbuffer/setlinebuf/setbuf uses setvbuf
// internally on NetBSD
#if defined(__NetBSD__)
void test_setbuf() {
  char buf[BUFSIZ];

  setbuf(stdout, NULL);

  print_something();

  setbuf(stdout, buf);

  print_something();
}

void test_setbuffer() {
  char buf[BUFSIZ];

  setbuffer(stdout, NULL, 0);

  print_something();

  setbuffer(stdout, buf, BUFSIZ);

  print_something();
}

void test_setlinebuf() {
  setlinebuf(stdout);

  print_something();
}
#endif

void test_setvbuf() {
  char buf[BUFSIZ];

  setvbuf(stdout, NULL, _IONBF, 0);

  print_something();

  setvbuf(stdout, buf, _IOLBF, BUFSIZ);

  print_something();

  setvbuf(stdout, buf, _IOFBF, BUFSIZ);

  print_something();
}

int main(void) {
  printf("setvbuf\n");

  test_setbuf();
  test_setbuffer();
  test_setlinebuf();
  test_setvbuf();

  // CHECK: setvbuf

  return 0;
}<commit_msg>[Sanitizer] Unbreak non NetBSD builds.<commit_after>// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s

// UNSUPPORTED: solaris

#include <stdio.h>

void print_something() {
  for (size_t i = 0; i < 10 * BUFSIZ; i++)
    printf("Hello world %zu\n", i);
}

// setbuffer/setlinebuf/setbuf uses setvbuf
// internally on NetBSD
#if defined(__NetBSD__)
void test_setbuf() {
  char buf[BUFSIZ];

  setbuf(stdout, NULL);

  print_something();

  setbuf(stdout, buf);

  print_something();
}

void test_setbuffer() {
  char buf[BUFSIZ];

  setbuffer(stdout, NULL, 0);

  print_something();

  setbuffer(stdout, buf, BUFSIZ);

  print_something();
}

void test_setlinebuf() {
  setlinebuf(stdout);

  print_something();
}
#endif

void test_setvbuf() {
  char buf[BUFSIZ];

  setvbuf(stdout, NULL, _IONBF, 0);

  print_something();

  setvbuf(stdout, buf, _IOLBF, BUFSIZ);

  print_something();

  setvbuf(stdout, buf, _IOFBF, BUFSIZ);

  print_something();
}

int main(void) {
  printf("setvbuf\n");

#if defined(__NetBSD__)
  test_setbuf();
  test_setbuffer();
  test_setlinebuf();
#endif
  test_setvbuf();

  // CHECK: setvbuf

  return 0;
}
{'fraction_non_alphanumeric': 0.15683646112600536, 'fraction_numerical': 0.00804289544235925, 'mean_word_length': 4.031460674157303, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5993779', 'n_tokens_mistral': 938, 'n_tokens_neox': 874, 'n_words': 199}