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