blob: 23321d548d6d8c00eab85ec3c50e3c59b679c32e [file] [log] [blame]
Balazs Benicsee073c72020-11-30 18:06:28 +01001// RUN: %clang_analyze_cc1 \
2// RUN: -analyzer-checker=core,apiModeling.StdCLibraryFunctions \
3// RUN: -analyzer-config apiModeling.StdCLibraryFunctions:ModelPOSIX=true \
4// RUN: -verify %s
5//
6// expected-no-diagnostics
7
8typedef long off_t;
9typedef long long off64_t;
10typedef unsigned long size_t;
11
12void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
13void *mmap64(void *addr, size_t length, int prot, int flags, int fd, off64_t offset);
14
15void test(long len) {
16 mmap(0, len, 2, 1, 0, 0); // no-crash
17 mmap64(0, len, 2, 1, 0, 0); // no-crash
18}