From 554bcb69c2d785a011a30e7db87a36a87fe7db10 Mon Sep 17 00:00:00 2001
From: dim <dim@FreeBSD.org>
Date: Wed, 15 Aug 2012 20:02:54 +0000
Subject: Vendor import of clang trunk r161861:
 http://llvm.org/svn/llvm-project/cfe/trunk@161861

---
 test/Sema/array-bounds-ptr-arith.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

(limited to 'test/Sema/array-bounds-ptr-arith.c')

diff --git a/test/Sema/array-bounds-ptr-arith.c b/test/Sema/array-bounds-ptr-arith.c
index 022335b..e3de06a 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];
+}
-- 
cgit v1.1