summaryrefslogtreecommitdiff
path: root/clang/test/Analysis/PR7218.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/PR7218.c')
-rw-r--r--clang/test/Analysis/PR7218.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Analysis/PR7218.c b/clang/test/Analysis/PR7218.c
new file mode 100644
index 0000000..1775e05
--- /dev/null
+++ b/clang/test/Analysis/PR7218.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store region -verify %s
+char PR7218(char a) {
+ char buf[2];
+ buf[0] = a;
+ return buf[1]; // expected-warning {{Undefined or garbage value returned to caller}}
+}