Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / pr4349.c
blob3bec499e0b3f575fa2fd2715c3cba8dddd43b10b
1 // RUN: %clang_cc1 %s -emit-llvm -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 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { ptr @cpu }]
20 struct svar svars1[] =
22 { &((cpu.pc).w[0]) }
24 // CHECK: @svars2 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { ptr getelementptr (i8, ptr @cpu, i64 1) }]
25 struct svar svars2[] =
27 { &((cpu.pc).b[0][1]) }
29 // CHECK: @svars3 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { ptr getelementptr (i8, ptr @cpu, i64 2) }]
30 struct svar svars3[] =
32 { &((cpu.pc).w[1]) }
34 // CHECK: @svars4 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { ptr getelementptr (i8, ptr @cpu, i64 3) }]
35 struct svar svars4[] =
37 { &((cpu.pc).b[1][1]) }