These tests were added in: 1daa48f005bd477ba8711ecdf91a1f1515f01383 59e422c90bf4796fc73237e838d8954b4e2099b1 malloc_zero.c and realloc_too_big.c fail when only leak sanitizer is enabled. http://lab.llvm.org:8011/#/builders/59/builds/1635 (also in an armv8 32 bit build) (I would XFAIL them but the same test is run with address and leak sanitizer enabled and that one does pass)
19 lines
499 B
C
19 lines
499 B
C
// RUN: %clang_lsan %s -o %t
|
|
// RUN: %env_lsan_opts=use_stacks=0 not %run %t 2>&1 | FileCheck %s
|
|
|
|
/// Fails when only leak sanitizer is enabled
|
|
// UNSUPPORTED: arm-linux, armhf-linux
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
// CHECK: {{Leak|Address}}Sanitizer: detected memory leaks
|
|
// CHECK: {{Leak|Address}}Sanitizer: 1 byte(s) leaked in 1 allocation(s).
|
|
|
|
int main() {
|
|
// The behavior of malloc(0) is implementation-defined.
|
|
char *p = malloc(0);
|
|
fprintf(stderr, "zero: %p\n", p);
|
|
p = 0;
|
|
}
|