From 28ba10ce2ad9b03ec33db3790a519d64a2e16b6a Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 3 Aug 2009 22:23:24 +0000 Subject: [PATCH] Add test case testing field sensitivity. Reduced from . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78008 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Analysis/misc-ps-region-store.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 . +// 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 + } + } +} -- 2.50.1