Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / Linux / syscalls.cpp
blobb4cb1a08dcfa18be4af6a7f3920a01008845f22c
1 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
4 #include <assert.h>
5 #include <errno.h>
6 #include <glob.h>
7 #include <stdio.h>
8 #include <string.h>
10 #include <sanitizer/linux_syscall_hooks.h>
12 /* Test the presence of __sanitizer_syscall_ in the tool runtime, and general
13 sanity of their behaviour. */
15 int main(int argc, char *argv[]) {
16 char buf[1000];
17 __sanitizer_syscall_pre_recvmsg(0, buf - 1, 0);
18 // CHECK: AddressSanitizer: stack-buffer-{{.*}}erflow
19 // CHECK: READ of size {{.*}} at {{.*}} thread T0
20 // CHECK: {{#[0-9]+ .*}} in __sanitizer_syscall{{.*}}recvmsg
21 return 0;