diff options
Diffstat (limited to 'test/Analysis/array-struct-region.c')
-rw-r--r-- | test/Analysis/array-struct-region.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Analysis/array-struct-region.c b/test/Analysis/array-struct-region.c index 4b085c8d70..8be86883a0 100644 --- a/test/Analysis/array-struct-region.c +++ b/test/Analysis/array-struct-region.c @@ -45,3 +45,16 @@ void nested_compound_literals_float(float rad) { vec[a][1] *= rad; // no-warning } } + + +void struct_as_array() { + struct simple { int x; }; + struct simple a; + struct simple *p = &a; + p->x = 5; + if (!p[0].x) + return; // expected-warning{{never executed}} + if (p[0].x) + return; // no-warning +} + |