llvm-project/clang/test/Analysis/std-c-library-posix-crash.c

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
582 B
C
Raw Normal View History

// RUN: %clang_analyze_cc1 \
// RUN: -analyzer-checker=core,apiModeling.StdCLibraryFunctions \
// RUN: -analyzer-config apiModeling.StdCLibraryFunctions:ModelPOSIX=true \
// RUN: -verify %s
//
// expected-no-diagnostics
typedef long off_t;
typedef long long off64_t;
typedef unsigned long size_t;
void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
void *mmap64(void *addr, size_t length, int prot, int flags, int fd, off64_t offset);
void test(long len) {
mmap(0, len, 2, 1, 0, 0); // no-crash
mmap64(0, len, 2, 1, 0, 0); // no-crash
}