| 1 | // RUN: %clang_msan -O0 -g %s -o %t && %run %t |
|---|---|
| 2 | |
| 3 | #include <assert.h> |
| 4 | #include <errno.h> |
| 5 | #include <string.h> |
| 6 | |
| 7 | int main() { |
| 8 | char buf[1000]; |
| 9 | char *res = strerror_r(EINVAL, buf: buf, buflen: sizeof(buf)); |
| 10 | assert(res); |
| 11 | volatile int z = strlen(s: res); |
| 12 | |
| 13 | res = strerror_r(errnum: -1, buf: buf, buflen: sizeof(buf)); |
| 14 | assert(res); |
| 15 | z = strlen(s: res); |
| 16 | |
| 17 | return 0; |
| 18 | } |
| 19 |
