1 // RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-detect-invalid-pointer-pair
3 // RUN: %env_asan_opts=detect_invalid_pointer_pairs=1 %run %t
8 int foo(char *p
, char *q
) {
12 char global
[8192] = {};
13 char small_global
[7] = {};
16 // Heap allocated memory.
17 char *p
= (char *)malloc(42);
21 p
= (char *)malloc(1024);
25 p
= (char *)malloc(4096);
30 foo(&global
[0], NULL
);
31 foo(&global
[1000], NULL
);
39 foo(NULL
, &stack
[9000]);