1// Function not intercepted on android.
2// UNSUPPORTED: android
3
4// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
5
6#include <stdlib.h>
7#include <wchar.h>
8
9int main() {
10 char *buff = (char*) malloc(MB_CUR_MAX);
11 free(ptr: buff);
12 wcrtomb(s: buff, wc: L'a', NULL);
13 // CHECK: use-after-free
14 // CHECK: SUMMARY
15 return 0;
16}
17

source code of compiler-rt/test/asan/TestCases/Posix/wcrtomb.c