1// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
2// RUN: %clangxx_msan -O3 -g %s -o %t && %run %t
3
4#include <assert.h>
5#include <stdlib.h>
6#include <sys/ioctl.h>
7#include <sys/socket.h>
8#include <unistd.h>
9
10int main(int argc, char **argv) {
11 int fd = socket(AF_UNIX, SOCK_DGRAM, protocol: 0);
12
13 unsigned int z;
14 int res = ioctl(fd: fd, FIOGETOWN, &z);
15 assert(res == 0);
16 close(fd: fd);
17 if (z)
18 exit(status: 0);
19 return 0;
20}
21

source code of compiler-rt/test/msan/ioctl.cpp