1// RUN: %clang_asan %s -o %t -framework Foundation
2// RUN: %run %t 2>&1 | FileCheck %s
3
4#import <Foundation/Foundation.h>
5#include <malloc/malloc.h>
6
7int main(int argc, char *argv[]) {
8 id obj = @0;
9 fprintf(stderr, "obj = %p\n", obj);
10 size_t size = malloc_size(obj);
11 fprintf(stderr, "size = 0x%zx\n", size);
12 fprintf(stderr, "Done.\n");
13 // CHECK: Done.
14 return 0;
15}
16

source code of compiler-rt/test/asan/TestCases/Darwin/malloc_size_crash.mm