23 lines · cpp
1// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s2// RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s3 4#include <assert.h>5#include <errno.h>6#include <glob.h>7#include <stdio.h>8#include <string.h>9 10#include <sanitizer/linux_syscall_hooks.h>11 12/* Test the presence of __sanitizer_syscall_ in the tool runtime, and general13 sanity of their behaviour. */14 15int main(int argc, char *argv[]) {16 char buf[1000];17 __sanitizer_syscall_pre_recvmsg(0, buf - 1, 0);18 // CHECK: AddressSanitizer: stack-buffer-{{.*}}erflow19 // CHECK: READ of size {{.*}} at {{.*}} thread T020 // CHECK: {{#[0-9]+ .*}} in __sanitizer_syscall{{.*}}recvmsg21 return 0;22}23