aboutsummaryrefslogtreecommitdiff
path: root/test/msan/Linux/strerror_r.cc
blob: aec653f9c0256bd1d450a64df43e4176aad79c42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: %clang_msan -O0 -g %s -o %t && %run %t

#include <assert.h>
#include <errno.h>
#include <string.h>

int main() {
  char buf[1000];
  char *res = strerror_r(EINVAL, buf, sizeof(buf));
  assert(res);
  volatile int z = strlen(res);

  res = strerror_r(-1, buf, sizeof(buf));
  assert(res);
  z = strlen(res);

  return 0;
}