[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Layout / ms-x86-empty-layout.c
blobdfcbb851977ed64dbe695e2538f9afab5149a5b1
1 // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fms-extensions -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
2 // RUN: | FileCheck %s
3 // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fms-extensions -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
4 // RUN: | FileCheck %s
6 struct EmptyIntMemb {
7 int FlexArrayMemb[0];
8 };
9 // CHECK: *** Dumping AST Record Layout
10 // CHECK-NEXT: 0 | struct EmptyIntMemb
11 // CHECK-NEXT: 0 | int[0] FlexArrayMemb
12 // CHECK-NEXT: | [sizeof=4, align=4
14 struct EmptyLongLongMemb {
15 long long FlexArrayMemb[0];
17 // CHECK: *** Dumping AST Record Layout
18 // CHECK-NEXT: 0 | struct EmptyLongLongMemb
19 // CHECK-NEXT: 0 | long long[0] FlexArrayMemb
20 // CHECK-NEXT: | [sizeof=4, align=8
22 struct EmptyAligned2LongLongMemb {
23 long long __declspec(align(2)) FlexArrayMemb[0];
26 // CHECK: *** Dumping AST Record Layout
27 // CHECK-NEXT: 0 | struct EmptyAligned2LongLongMemb
28 // CHECK-NEXT: 0 | long long[0] FlexArrayMemb
29 // CHECK-NEXT: | [sizeof=4, align=8
31 struct EmptyAligned8LongLongMemb {
32 long long __declspec(align(8)) FlexArrayMemb[0];
35 // CHECK: *** Dumping AST Record Layout
36 // CHECK-NEXT: 0 | struct EmptyAligned8LongLongMemb
37 // CHECK-NEXT: 0 | long long[0] FlexArrayMemb
38 // CHECK-NEXT: | [sizeof=8, align=8
40 #pragma pack(1)
41 struct __declspec(align(4)) EmptyPackedAligned4LongLongMemb {
42 long long FlexArrayMemb[0];
44 #pragma pack()
46 // CHECK: *** Dumping AST Record Layout
47 // CHECK-NEXT: 0 | struct EmptyPackedAligned4LongLongMemb
48 // CHECK-NEXT: 0 | long long[0] FlexArrayMemb
49 // CHECK-NEXT: | [sizeof=4, align=4
51 #pragma pack(1)
52 struct EmptyPackedAligned8LongLongMemb {
53 long long __declspec(align(8)) FlexArrayMemb[0];
55 #pragma pack()
57 // CHECK: *** Dumping AST Record Layout
58 // CHECK-NEXT: 0 | struct EmptyPackedAligned8LongLongMemb
59 // CHECK-NEXT: 0 | long long[0] FlexArrayMemb
60 // CHECK-NEXT: | [sizeof=8, align=8
63 int a[
64 sizeof(struct EmptyIntMemb)+
65 sizeof(struct EmptyLongLongMemb)+
66 sizeof(struct EmptyAligned2LongLongMemb)+
67 sizeof(struct EmptyAligned8LongLongMemb)+
68 sizeof(struct EmptyPackedAligned4LongLongMemb)+
69 sizeof(struct EmptyPackedAligned8LongLongMemb)+
70 0];