brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 6845173 Raw
69 lines · c
1// RUN: %clang_cc1 -triple x86_64-apple-macosx10.7.0 -emit-llvm -o - %s | FileCheck %s2 3// PR46104#pragma pack(4)5struct ref {6        struct ref *next;7} refs;8 9// PR1358010struct S11{12  char a[3];13#pragma pack(1)14  struct T15  {16    char b;17    int c;18  } d;19#pragma pack()20  struct T221  {22    char b;23    int c;24  } d2;25} ss;26 27struct S328{29  char a[3];30#pragma pack(push, 2)31  struct T332  {33    char b;34    int c;35  } d;36#pragma pack(pop)37  struct T3238  {39    char b;40    int c;41  } e;42} s3;43 44struct S445{46  char a[3];47#pragma align=packed48  struct T449  {50    char b;51    int c;52  } d;53  int e;54} s4;55 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 }60 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 }>66 67// CHECK: @refs ={{.*}} global [[struct_ref]]68// CHECK: @ss ={{.*}} global [[struct_S]]69