brintos

brintos / llvm-project-archived public Read only

0
0
Text · 441 B · d55bf42 Raw
19 lines · c
1// RUN: %clang_msan -std=c99 -O0 -g %s -o %t && %run %t2 3// strerror_r under a weird set of circumstances can be redirected to4// __xpg_strerror_r. Test that MSan handles this correctly.5 6#define _POSIX_C_SOURCE 2001127#include <assert.h>8#include <stdio.h>9#include <string.h>10#include <errno.h>11 12int main() {13  char buf[1000];14  int res = strerror_r(EINVAL, buf, sizeof(buf));15  assert(!res);16  volatile int z = strlen(buf);17  return 0;18}19