Move MSan lit-tests under test/msan
[blocksruntime.git] / test / msan / errno.cc
blobaf27ad0b03298763ceb31e1bf4c69c3bb493590f
1 // RUN: %clangxx_msan -m64 -O0 %s -o %t && %t
3 #include <assert.h>
4 #include <errno.h>
5 #include <stdio.h>
6 #include <unistd.h>
8 int main()
10 int x;
11 int *volatile p = &x;
12 errno = *p;
13 int res = read(-1, 0, 0);
14 assert(res == -1);
15 if (errno) printf("errno %d\n", errno);
16 return 0;