summaryrefslogtreecommitdiffstats
path: root/test/Analysis/reference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/reference.cpp')
-rw-r--r--test/Analysis/reference.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Analysis/reference.cpp b/test/Analysis/reference.cpp
new file mode 100644
index 0000000..a641b8e
--- /dev/null
+++ b/test/Analysis/reference.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
+
+void f1() {
+ int const &i = 3;
+ int b = i;
+
+ int *p = 0;
+
+ if (b != 3)
+ *p = 1; // no-warning
+}
OpenPOWER on IntegriCloud