1 | // RUN: %clangxx_asan %s -o %t && %run %t 2>&1 | FileCheck %s |
2 | |
3 | #include <malloc/malloc.h> |
4 | #include <stdlib.h> |
5 | #include <stdio.h> |
6 | |
7 | int main() { |
8 | fprintf(stderr, format: "start\n" ); |
9 | malloc_zone_t *zone = malloc_create_zone(0, 0); |
10 | fprintf(stderr, "zone = %p\n" , zone); |
11 | malloc_set_zone_name(zone, "myzone" ); |
12 | fprintf(stderr, format: "name changed\n" ); |
13 | malloc_destroy_zone(zone); |
14 | fprintf(stderr, format: "done\n" ); |
15 | return 0; |
16 | } |
17 | |
18 | // CHECK: start |
19 | // CHECK-NEXT: zone = 0x{{.*}} |
20 | // CHECK-NEXT: name changed |
21 | // CHECK-NEXT: done |
22 | |