blob: 026d4f5476f69f3d7871bbcf9cfcaa03e09d93b2 [file] [log] [blame]
Ted Kremenek565e4652010-02-05 02:06:54 +00001// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=region -verify -fblocks %s
Ted Kremenek0c106992009-07-14 23:17:22 +00002
Ted Kremeneka6275a52009-07-15 02:31:43 +00003// Here is a case where a pointer is treated as integer, invalidated as an
4// integer, and then used again as a pointer. This test just makes sure
5// we don't crash.
6typedef unsigned uintptr_t;
7void test_pointer_invalidated_as_int_aux(uintptr_t* ptr);
8void test_pointer_invalidated_as_int() {
9 void *x;
10 test_pointer_invalidated_as_int_aux((uintptr_t*) &x);
11 // Here we have a pointer to integer cast.
12 uintptr_t y = (uintptr_t) x;
Ted Kremenek0c106992009-07-14 23:17:22 +000013}
14