1 // RUN: %clangxx_asan %s -o %t
2 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=A1
3 // RUN: not %run %t 1 2>&1 | FileCheck %s --check-prefix=A2
4 // RUN: %env_asan_opts=intercept_memmem=0 %run %t
7 int main(int argc
, char **argv
) {
8 char a1
[] = {1, 2, 3, 4, 5, 6, 7, 8};
12 res
= memmem(a1
, sizeof(a1
) + 1, a2
, sizeof(a2
)); // BOOM
14 res
= memmem(a1
, sizeof(a1
), a2
, sizeof(a2
) + 1); // BOOM
15 // A1: AddressSanitizer: stack-buffer-overflow
17 // A1-NEXT: {{#1.*main}}
18 // A1: 'a1'{{.*}} <== Memory access at offset
20 // A2: AddressSanitizer: stack-buffer-overflow
22 // A2: 'a2'{{.*}} <== Memory access at offset