Fixed some bugs.
[llvm/zpu.git] / test / FrontendC / pr4349.c
blobfbd7e56eba15333ba8e12c39095712091737d7b3
1 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | FileCheck %s
2 // PR 4349
4 union reg
6 unsigned char b[2][2];
7 unsigned short w[2];
8 unsigned int d;
9 };
10 struct cpu
12 union reg pc;
14 extern struct cpu cpu;
15 struct svar
17 void *ptr;
19 // CHECK: @svars1 = global [1 x %struct.svar] [%struct.svar { i8* bitcast (%struct.cpu* @cpu to i8*) }]
20 struct svar svars1[] =
22 { &((cpu.pc).w[0]) }
24 // CHECK: @svars2 = global [1 x %struct.svar] [%struct.svar { i8* getelementptr ([2 x i8]* bitcast (%struct.cpu* @cpu to [2 x i8]*), i{{[0-9]+}} 0, i{{[0-9]+}} 1) }]
25 struct svar svars2[] =
27 { &((cpu.pc).b[0][1]) }
29 // CHECK: @svars3 = global [1 x %struct.svar] [%struct.svar { i8* bitcast (i16* getelementptr ([2 x i16]* bitcast (%struct.cpu* @cpu to [2 x i16]*), i{{[0-9]+}} 0, i{{[0-9]+}} 1) to i8*) }]
30 struct svar svars3[] =
32 { &((cpu.pc).w[1]) }
34 // CHECK: @svars4 = global [1 x %struct.svar] [%struct.svar { i8* getelementptr ([2 x [2 x i8]]* bitcast (%struct.cpu* @cpu to [2 x [2 x i8]]*), i{{[0-9]+}} 0, i{{[0-9]+}} 1, i{{[0-9]+}} 1) }]
35 struct svar svars4[] =
37 { &((cpu.pc).b[1][1]) }