From 579a05d767674b7e8b45161e1489a29ee3c25de2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 4 Apr 2008 18:42:16 +0000 Subject: 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. llvm-svn: 49226 --- clang/test/CodeGen/init-with-member-expr.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'clang/test') diff --git a/clang/test/CodeGen/init-with-member-expr.c b/clang/test/CodeGen/init-with-member-expr.c index f82a135415a..606f9dc8d00 100644 --- a/clang/test/CodeGen/init-with-member-expr.c +++ b/clang/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 @@ extern struct test t; 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; +} + -- cgit v1.2.1