1 // RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-detect-invalid-pointer-pair
3 // RUN: %env_asan_opts=detect_invalid_pointer_pairs=2 %run %t
4 // RUN: %env_asan_opts=detect_invalid_pointer_pairs=2,detect_stack_use_after_return=0 %run %t
9 int bar(char *p
, char *q
) {
13 char global
[10000] = {};
16 // Heap allocated memory.
17 char *p
= (char *)malloc(42);
18 int r
= bar(p
, p
+ 20);
22 bar(&global
[0], &global
[100]);
23 bar(&global
[1000], &global
[9000]);
24 bar(&global
[500], &global
[10]);
25 bar(&global
[0], &global
[10000]);
29 bar(&stack
[0], &stack
[100]);
30 bar(&stack
[1000], &stack
[9000]);
31 bar(&stack
[500], &stack
[10]);