Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / pragma-pack-1.c
blob68451735cae0d74f9e0608725ad5ac045f8f7fb7
1 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.7.0 -emit-llvm -o - %s | FileCheck %s
3 // PR4610
4 #pragma pack(4)
5 struct ref {
6 struct ref *next;
7 } refs;
9 // PR13580
10 struct S
12 char a[3];
13 #pragma pack(1)
14 struct T
16 char b;
17 int c;
18 } d;
19 #pragma pack()
20 struct T2
22 char b;
23 int c;
24 } d2;
25 } ss;
27 struct S3
29 char a[3];
30 #pragma pack(push, 2)
31 struct T3
33 char b;
34 int c;
35 } d;
36 #pragma pack(pop)
37 struct T32
39 char b;
40 int c;
41 } e;
42 } s3;
44 struct S4
46 char a[3];
47 #pragma align=packed
48 struct T4
50 char b;
51 int c;
52 } d;
53 int e;
54 } s4;
56 // CHECK: [[struct_ref:%[a-zA-Z0-9_.]+]] = type { ptr }
57 // CHECK: [[struct_S:%[a-zA-Z0-9_.]+]] = type { [3 x i8], [[struct_T:%[a-zA-Z0-9_.]+]], [[struct_T2:%[a-zA-Z0-9_.]+]] }
58 // CHECK: [[struct_T]] = type <{ i8, i32 }>
59 // CHECK: [[struct_T2]] = type { i8, i32 }
61 // CHECK: %struct.S3 = type { [3 x i8], i8, %struct.T3, %struct.T32 }
62 // CHECK: %struct.T3 = type <{ i8, i8, i32 }>
63 // CHECK: %struct.T32 = type { i8, i32 }
64 // CHECK: %struct.S4 = type { [3 x i8], %struct.T4, i32 }
65 // CHECK: %struct.T4 = type <{ i8, i32 }>
67 // CHECK: @refs ={{.*}} global [[struct_ref]]
68 // CHECK: @ss ={{.*}} global [[struct_S]]