summaryrefslogtreecommitdiffstats
path: root/test/Analysis/unions-region.m
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-08-06 22:33:36 +0000
committerTed Kremenek <kremenek@apple.com>2009-08-06 22:33:36 +0000
commit566a6faa54235590ab8d7d177dfac08586f545b0 (patch)
tree647ad583af62ae694f8a847e6c0669601ff674ba /test/Analysis/unions-region.m
parent657c1acfc47d5c315ce864f2089b692262532a17 (diff)
Fix a few more false positives involving RegionStore and unions, but this time
with array accesses. In the process, refactor some common logic in RetrieveElement() and RetrieveField() into RetrieveFieldOrElementCommon(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/unions-region.m')
-rw-r--r--test/Analysis/unions-region.m17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/Analysis/unions-region.m b/test/Analysis/unions-region.m
index d253009d8b..be4f1852bf 100644
--- a/test/Analysis/unions-region.m
+++ b/test/Analysis/unions-region.m
@@ -6,10 +6,9 @@
//
//===----------------------------------------------------------------------===//
-// When using RegionStore, this test case previously had a false positive
-// of a 'pass-by-value argument is uninitialized' warning at the call to
-// 'testA_aux'.
-
+// [testA] When using RegionStore, this test case previously had a
+// false positive of a 'pass-by-value argument is uninitialized'
+// warning at the call to 'testA_aux' and 'testA_aux_2'.
union u_testA {
unsigned i;
float f;
@@ -30,3 +29,13 @@ float testA(float f) {
return swap.f;
}
+// [testB] When using RegionStore, this test case previously had a
+// false positive of a 'pass-by-value argument is uninitialized'
+// warning at the call to 'testB_aux'.
+void testB(int i) {
+ void testB_aux(short z);
+ union { short x[2]; unsigned y; } val;
+ val.y = 10;
+ testB_aux(val.x[1]); // no-warning
+}
+