blob: 890482ea06a57177047342bddd8b0b6c6210eab4 [file] [log] [blame]
Dale Johannesenc90f49e2009-06-11 20:48:09 +00001// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars2 | grep {\\\[2 x \\\[2 x i8\\\]\\\]}
Dan Gohmanc2f26f52009-06-12 23:31:14 +00002// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars2 | grep {, i\[\[:digit:\]\]\\+ 1)} | count 1
Dale Johannesenc90f49e2009-06-11 20:48:09 +00003// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars3 | grep {\\\[2 x i16\\\]}
Dan Gohmanc2f26f52009-06-12 23:31:14 +00004// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars3 | grep {, i\[\[:digit:\]\]\\+ 1)} | count 1
Dale Johannesenc90f49e2009-06-11 20:48:09 +00005// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars4 | grep {\\\[2 x \\\[2 x i8\\\]\\\]} | count 1
Dan Gohmanc2f26f52009-06-12 23:31:14 +00006// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep svars4 | grep {, i\[\[:digit:\]\]\\+ 1, i\[\[:digit:\]\]\\+ 1)} | count 1
Dale Johannesenc90f49e2009-06-11 20:48:09 +00007// PR 4349
8
9union reg
10{
11 unsigned char b[2][2];
12 unsigned short w[2];
13 unsigned int d;
14};
15struct cpu
16{
17 union reg pc;
18};
19extern struct cpu cpu;
20struct svar
21{
22 void *ptr;
23};
24struct svar svars1[] =
25{
26 { &((cpu.pc).w[0]) }
27};
28struct svar svars2[] =
29{
30 { &((cpu.pc).b[0][1]) }
31};
32struct svar svars3[] =
33{
34 { &((cpu.pc).w[1]) }
35};
36struct svar svars4[] =
37{
38 { &((cpu.pc).b[1][1]) }
39};