1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm < %s | FileCheck %s
3 typedef __SIZE_TYPE__
size_t;
6 void *calloc(size_t, size_t);
7 void *realloc(void *, size_t);
8 void *aligned_alloc(size_t, size_t);
9 void *memalign(size_t, size_t);
11 void *malloc_test(size_t n
) {
15 void *calloc_test(size_t e
, size_t n
) {
19 void *realloc_test(void *p
, size_t n
) {
23 void *aligned_alloc_test(size_t n
, size_t a
) {
24 return aligned_alloc(a
, n
);
27 void *memalign_test(size_t n
, size_t a
) {
28 return memalign(a
, n
);
31 // CHECK: @malloc(i64 noundef) #1
32 // CHECK: @calloc(i64 noundef, i64 noundef) #2
33 // CHECK: @realloc(ptr noundef, i64 noundef) #3
34 // CHECK: @aligned_alloc(i64 noundef, i64 noundef) #3
35 // CHECK: @memalign(i64 noundef, i64 noundef) #3
37 // CHECK: attributes #1 = { allocsize(0)
38 // CHECK: attributes #2 = { allocsize(0,1)
39 // CHECK: attributes #3 = { allocsize(1)