summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-06-11 20:48:09 +0000
committerDale Johannesen <dalej@apple.com>2009-06-11 20:48:09 +0000
commit4bd5463617df60cd9b84220abfbf54ce6223a5d4 (patch)
tree5c9bb978a89a6a525ef7b2184d478e892a92514d
parent7433a248e3f74c28aaf9e2284470d1c2346b5740 (diff)
downloadbcm5719-llvm-4bd5463617df60cd9b84220abfbf54ce6223a5d4.tar.gz
bcm5719-llvm-4bd5463617df60cd9b84220abfbf54ce6223a5d4.zip
Test for rev 73205 (PR 4349)
llvm-svn: 73206
-rw-r--r--llvm/test/FrontendC/pr4349.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/llvm/test/FrontendC/pr4349.c b/llvm/test/FrontendC/pr4349.c
new file mode 100644
index 00000000000..10ba9962f3f
--- /dev/null
+++ b/llvm/test/FrontendC/pr4349.c
@@ -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]) }
+};
OpenPOWER on IntegriCloud