summaryrefslogtreecommitdiffstats
path: root/test/Analysis/fields.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/fields.c')
-rw-r--r--test/Analysis/fields.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/Analysis/fields.c b/test/Analysis/fields.c
index 2e72c77..12e8bbf 100644
--- a/test/Analysis/fields.c
+++ b/test/Analysis/fields.c
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core %s -analyzer-store=region -verify
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection %s -analyzer-store=region -verify
+
+void clang_analyzer_eval(int);
unsigned foo();
typedef struct bf { unsigned x:2; } bf;
@@ -26,3 +28,11 @@ void test() {
Point p;
(void)(p = getit()).x;
}
+
+
+void testLazyCompoundVal() {
+ Point p = {42, 0};
+ Point q;
+ clang_analyzer_eval((q = p).x == 42); // expected-warning{{TRUE}}
+ clang_analyzer_eval(q.x == 42); // expected-warning{{TRUE}}
+}
OpenPOWER on IntegriCloud