[llvm-commits] [llvm] r73206 - /llvm/trunk/test/FrontendC/pr4349.c

Dale Johannesen dalej at apple.com
Thu Jun 11 13:48:10 PDT 2009


Author: johannes
Date: Thu Jun 11 15:48:09 2009
New Revision: 73206

URL: http://llvm.org/viewvc/llvm-project?rev=73206&view=rev
Log:
Test for rev 73205 (PR 4349)


Added:
    llvm/trunk/test/FrontendC/pr4349.c

Added: llvm/trunk/test/FrontendC/pr4349.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/pr4349.c?rev=73206&view=auto

==============================================================================
--- llvm/trunk/test/FrontendC/pr4349.c (added)
+++ llvm/trunk/test/FrontendC/pr4349.c Thu Jun 11 15:48:09 2009
@@ -0,0 +1,39 @@
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars2 | grep {\\\[2 x \\\[2 x i8\\\]\\\]}
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars2 | grep {i32 1} | count 1
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars3 | grep {\\\[2 x i16\\\]}
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars3 | grep {i32 1} | count 1
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars4 | grep {\\\[2 x \\\[2 x i8\\\]\\\]} | count 1
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars4 | grep {i32 1, i32 1} | count 1
+// PR 4349
+
+union reg
+{
+    unsigned char b[2][2];
+    unsigned short w[2];
+    unsigned int d;
+};
+struct cpu
+{
+    union reg pc;
+};
+extern struct cpu cpu;
+struct svar
+{
+    void *ptr;
+};
+struct svar svars1[] =
+{
+    { &((cpu.pc).w[0]) }
+};
+struct svar svars2[] =
+{
+    { &((cpu.pc).b[0][1]) }
+};
+struct svar svars3[] =
+{
+    { &((cpu.pc).w[1]) }
+};
+struct svar svars4[] =
+{
+    { &((cpu.pc).b[1][1]) }
+};





More information about the llvm-commits mailing list