summaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2017-11-07 10:51:15 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2017-11-07 10:51:15 +0000
commit8ab0d100c3892fab13cfdf473671414ff7642925 (patch)
tree78fa760805ac9b291b0f657dd9ccbddcff5d7efd /test/Analysis
parent748ac787214a585e4fd7b5de94f564b9310e43d4 (diff)
[analyzer] pr34779: CStringChecker: Accept non-standard headers.
Do not crash when trying to define and call a non-standard strcpy(unsigned char *, unsigned char *) during analysis. At the same time, do not try to actually evaluate the call. Differential Revision: https://reviews.llvm.org/D39422 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317565 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/string-with-signedness.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Analysis/string-with-signedness.c b/test/Analysis/string-with-signedness.c
new file mode 100644
index 0000000000..1b00971a83
--- /dev/null
+++ b/test/Analysis/string-with-signedness.c
@@ -0,0 +1,10 @@
+// RUN: %clang_analyze_cc1 -Wno-incompatible-library-redeclaration -analyzer-checker=core,unix.cstring,alpha.unix.cstring -verify %s
+
+// expected-no-diagnostics
+
+void *strcpy(unsigned char *, unsigned char *);
+
+unsigned char a, b;
+void testUnsignedStrcpy() {
+ strcpy(&a, &b);
+}