summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-01-11 02:33:26 +0000
committerTed Kremenek <kremenek@apple.com>2010-01-11 02:33:26 +0000
commitbe909b5eff3b1383d141a9f9f8981a0f3249845d (patch)
treeb525de315aa3dc406227e368d4cd7c45c7b173e5 /clang/test
parent8e994a2808afed750109c45492b7d683870fbfed (diff)
downloadbcm5719-llvm-be909b5eff3b1383d141a9f9f8981a0f3249845d.tar.gz
bcm5719-llvm-be909b5eff3b1383d141a9f9f8981a0f3249845d.zip
Switch RegionStore over to using <BaseRegion+raw offset> to store
value bindings. Along with a small change to OSAtomicChecker, this resolves <rdar://problem/7527292> and resolves some long-standing issues with how values can be bound to the same physical address by not have the same "key". This change is only a beginning; logically RegionStore needs to better handle loads from addresses where the stored value is larger/smaller/different type than the loaded value. We handle these cases in an approximate fashion now (via CastRetrievedVal and help in SimpleSValuator), but it could be made much smarter. llvm-svn: 93137
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/misc-ps-region-store.m20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/Analysis/misc-ps-region-store.m b/clang/test/Analysis/misc-ps-region-store.m
index df423efeaeb..a88c26c29ed 100644
--- a/clang/test/Analysis/misc-ps-region-store.m
+++ b/clang/test/Analysis/misc-ps-region-store.m
@@ -710,3 +710,23 @@ int test_return_struct_2_rdar_7526777() {
return test_return_struct_2_aux_rdar_7526777().x;
}
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7527292> Assertion failed: (Op == BinaryOperator::Add ||
+// Op == BinaryOperator::Sub)
+// This test case previously triggered an assertion failure due to a discrepancy
+// been the loaded/stored value in the array
+//===----------------------------------------------------------------------===//
+
+_Bool OSAtomicCompareAndSwapPtrBarrier( void *__oldValue, void *__newValue, void * volatile *__theValue );
+
+void rdar_7527292() {
+ static id Cache7527292[32];
+ for (signed long idx = 0;
+ idx < 32;
+ idx++) {
+ id v = Cache7527292[idx];
+ if (v && OSAtomicCompareAndSwapPtrBarrier(v, ((void*)0), (void * volatile *)(Cache7527292 + idx))) {
+ }
+ }
+}
+
OpenPOWER on IntegriCloud