189a1d03eSRichard // RUN: %check_clang_tidy %s cppcoreguidelines-no-malloc %t \
289a1d03eSRichard // RUN: -config='{CheckOptions: \
3*e8a3ddafSNathan James // RUN:  {cppcoreguidelines-no-malloc.Allocations: "::malloc",\
4*e8a3ddafSNathan James // RUN:   cppcoreguidelines-no-malloc.Reallocations: "",\
5*e8a3ddafSNathan James // RUN:   cppcoreguidelines-no-malloc.Deallocations: ""}}' \
689a1d03eSRichard // RUN: --
789a1d03eSRichard 
889a1d03eSRichard // Just ensure, the check will not crash, when no functions shall be checked.
989a1d03eSRichard 
1089a1d03eSRichard using size_t = __SIZE_TYPE__;
1189a1d03eSRichard 
1289a1d03eSRichard void *malloc(size_t size);
1389a1d03eSRichard 
malloced_array()1489a1d03eSRichard void malloced_array() {
1589a1d03eSRichard   int *array0 = (int *)malloc(sizeof(int) * 20);
1689a1d03eSRichard   // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: do not manage memory manually; consider a container or a smart pointer [cppcoreguidelines-no-malloc]
1789a1d03eSRichard }
18