1 // RUN: %clangxx_asan -O0 -g %s -o %t && %env_asan_opts=handle_ioctl=1 not %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_asan -O3 -g %s -o %t && %env_asan_opts=handle_ioctl=1 not %run %t 2>&1 | FileCheck %s
4 // RUN: %clangxx_asan -O0 -g %s -o %t && %run %t
5 // RUN: %clangxx_asan -O3 -g %s -o %t && %run %t
10 #include <sys/socket.h>
13 int main(int argc, char **argv) {
14 int fd = socket(AF_INET, SOCK_DGRAM, 0);
17 int res = ioctl(fd, FIONBIO, &nonblock + 1);
18 // CHECK: AddressSanitizer: stack-buffer-overflow
19 // CHECK: READ of size 4 at
20 // CHECK: {{#.* in main .*ioctl.cc:}}[[@LINE-3]]