Files
clang-p2996/compiler-rt/test/lsan/TestCases/malloc_zero.c
David Spickett 466fab5c94 [lsan] Mark 2 new lsan tests unsupported on arm-linux
These tests were added in:
1daa48f005
59e422c90b

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)
2021-04-08 15:57:46 +01:00

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;
}