diff options
author | Artem Dergachev <artem.dergachev@gmail.com> | 2019-08-28 18:44:38 +0000 |
---|---|---|
committer | Artem Dergachev <artem.dergachev@gmail.com> | 2019-08-28 18:44:38 +0000 |
commit | 630f7daf80fe36d3aa4a9ebe60e7abefae514bba (patch) | |
tree | 476edc9fbf1518b032ec8188114f17e501780205 /clang/test/Analysis/cstring-syntax.c | |
parent | 0909a392f318872a1eacbdc9a6044cb437095a11 (diff) | |
download | bcm5719-llvm-630f7daf80fe36d3aa4a9ebe60e7abefae514bba.tar.gz bcm5719-llvm-630f7daf80fe36d3aa4a9ebe60e7abefae514bba.zip |
[analyzer] Fix analyzer warnings on analyzer.
Write tests for the actual crash that was found. Write comments and refactor
code around 17 style bugs and suppress 3 false positives.
Differential Revision: https://reviews.llvm.org/D66847
llvm-svn: 370246
Diffstat (limited to 'clang/test/Analysis/cstring-syntax.c')
-rw-r--r-- | clang/test/Analysis/cstring-syntax.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/clang/test/Analysis/cstring-syntax.c b/clang/test/Analysis/cstring-syntax.c index f01de36c1af..8ac971fe241 100644 --- a/clang/test/Analysis/cstring-syntax.c +++ b/clang/test/Analysis/cstring-syntax.c @@ -1,7 +1,18 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s -// RUN: %clang_analyze_cc1 -triple armv7-a15-linux -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s -// RUN: %clang_analyze_cc1 -triple aarch64_be-none-linux-gnu -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s +// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -verify %s\ +// RUN: -Wno-strncat-size -Wno-sizeof-pointer-memaccess \ +// RUN: -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument +// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -verify %s\ +// RUN: -Wno-strncat-size -Wno-sizeof-pointer-memaccess \ +// RUN: -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument\ +// RUN: -triple armv7-a15-linux +// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -verify %s\ +// RUN: -Wno-strncat-size -Wno-sizeof-pointer-memaccess \ +// RUN: -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument\ +// RUN: -triple aarch64_be-none-linux-gnu +// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -verify %s\ +// RUN: -Wno-strncat-size -Wno-sizeof-pointer-memaccess \ +// RUN: -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument\ +// RUN: -triple i386-apple-darwin10 typedef __SIZE_TYPE__ size_t; char *strncat(char *, const char *, size_t); |