diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 56d91b49b13fe55c918afbda19f6165b5fbff87a (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/Sema/array-bounds-ptr-arith.c | |
parent | 41e20f564abdb05101d6b2b29c59459a966c22cc (diff) |
Notes
Diffstat (limited to 'test/Sema/array-bounds-ptr-arith.c')
-rw-r--r-- | test/Sema/array-bounds-ptr-arith.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Sema/array-bounds-ptr-arith.c b/test/Sema/array-bounds-ptr-arith.c index 022335bd37a7..e3de06a104e4 100644 --- a/test/Sema/array-bounds-ptr-arith.c +++ b/test/Sema/array-bounds-ptr-arith.c @@ -19,3 +19,21 @@ void pr11594(struct S *s) { int a[10]; int *p = a - s->n; } + +// Test case reduced from <rdar://problem/11387038>. This resulted in +// an assertion failure because of the typedef instead of an explicit +// constant array type. +struct RDar11387038 {}; +typedef struct RDar11387038 RDar11387038Array[1]; +struct RDar11387038_Table { + RDar11387038Array z; +}; +typedef struct RDar11387038_Table * TPtr; +typedef TPtr *TabHandle; +struct RDar11387038_B { TabHandle x; }; +typedef struct RDar11387038_B RDar11387038_B; + +void radar11387038() { + RDar11387038_B *pRDar11387038_B; + struct RDar11387038* y = &(*pRDar11387038_B->x)->z[4]; +} |