2 // RUN: %clang_analyze_cc1 -fblocks \
3 // RUN: -analyzer-checker=core \
4 // RUN: -analyzer-checker=unix.Malloc \
5 // RUN: -analyzer-checker=unix.cstring.NullArg \
6 // RUN: -analyzer-disable-checker=alpha.unix.cstring.OutOfBounds \
7 // RUN: -analyzer-output=plist -o %t %s
8 // RUN: FileCheck -input-file %t %s
10 typedef __typeof(sizeof(int)) size_t;
13 char *strncpy(char *restrict s1
, const char *restrict s2
, size_t n
);
17 void cstringchecker_bounds_nocrash(void) {
19 strncpy(p
, "AAA", sizeof("AAA")); // we don't expect warning as the checker is disabled
23 // CHECK: <key>diagnostics</key>
24 // CHECK-NEXT: <array>
25 // CHECK-NEXT: </array>
26 // CHECK-NEXT: <key>files</key>
27 // CHECK-NEXT: <array>
28 // CHECK-NEXT: </array>
29 // CHECK-NEXT: </dict>
30 // CHECK-NEXT: </plist>