Fix PR2049, updating Eli's patch that fixes to mainline. This produces incorrect
code, but the codegen doesn't crash. I'll file a bugzilla for the AST being wrong.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49226 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/init-with-member-expr.c b/test/CodeGen/init-with-member-expr.c
index f82a135..606f9dc 100644
--- a/test/CodeGen/init-with-member-expr.c
+++ b/test/CodeGen/init-with-member-expr.c
@@ -1,4 +1,4 @@
-// RUN: clang %s -emit-llvm
+// RUN: clang < %s -emit-llvm
struct test {
int a;
};
@@ -7,3 +7,15 @@
int *b=&t.a;
+
+// PR2049
+typedef struct mark_header_tag {
+ unsigned char mark[7];
+} mark_header_t;
+int is_rar_archive(int fd) {
+ const mark_header_t rar_hdr[2] = {{0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00}, {'U', 'n', 'i', 'q', 'u', 'E', '!'}};
+ foo(rar_hdr);
+
+ return 0;
+}
+