diff options
-rw-r--r-- | test/Analysis/misc-ps-region-store.m | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/misc-ps-region-store.m b/test/Analysis/misc-ps-region-store.m index 2b0299f23f..6cfd8e5372 100644 --- a/test/Analysis/misc-ps-region-store.m +++ b/test/Analysis/misc-ps-region-store.m @@ -139,3 +139,18 @@ again: goto again; } } + +// Reduced test case from <rdar://problem/7114618>. +// Basically a null check is performed on the field value, which is then +// assigned to a variable and then checked again. +struct s_7114618 { int *p; }; +void test_rdar_7114618(struct s_7114618 *s) { + if (s->p) { + int *p = s->p; + if (!p) { + // Infeasible + int *dead = 0; + *dead = 0xDEADBEEF; // no-warning + } + } +} |