brintos

brintos / llvm-project-archived public Read only

0
0
Text · 291 B · 6ed0fd4 Raw
18 lines · cpp
1// RUN: %clangxx_msan -O0 %s -o %t && %run %t2 3#include <assert.h>4#include <errno.h>5#include <stdio.h>6#include <unistd.h>7 8int main()9{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;17}18