40 lines · c
1// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm < %s | FileCheck %s2 3typedef __SIZE_TYPE__ size_t;4 5void *malloc(size_t);6void *calloc(size_t, size_t);7void *realloc(void *, size_t);8void *aligned_alloc(size_t, size_t);9void *memalign(size_t, size_t);10 11void *malloc_test(size_t n) {12 return malloc(n);13}14 15void *calloc_test(size_t e, size_t n) {16 return calloc(e, n);17}18 19void *realloc_test(void *p, size_t n) {20 return realloc(p, n);21}22 23void *aligned_alloc_test(size_t n, size_t a) {24 return aligned_alloc(a, n);25}26 27void *memalign_test(size_t n, size_t a) {28 return memalign(a, n);29}30 31// CHECK: @malloc(i64 noundef) #132// CHECK: @calloc(i64 noundef, i64 noundef) #233// CHECK: @realloc(ptr noundef, i64 noundef) #334// CHECK: @aligned_alloc(i64 noundef, i64 noundef) #335// CHECK: @memalign(i64 noundef, i64 noundef) #336 37// CHECK: attributes #1 = { allocsize(0)38// CHECK: attributes #2 = { allocsize(0,1)39// CHECK: attributes #3 = { allocsize(1)40