blob: 98acac1f13b29f9e125b26afbaa1f50ea2fd4625 [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 Gohmanbd6c26f2009-06-12 23:02:02 +00002// RUN: %llvmgcc -m32 %s -S -emit-llvm -O0 -o - | grep svars2 | grep {i32 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 Gohmanbd6c26f2009-06-12 23:02:02 +00004// RUN: %llvmgcc -m32 %s -S -emit-llvm -O0 -o - | grep svars3 | grep {i32 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 Gohmanbd6c26f2009-06-12 23:02:02 +00006// RUN: %llvmgcc -m32 %s -S -emit-llvm -O0 -o - | grep svars4 | grep {i32 1, i32 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};