[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Layout / aix-no-unique-address-with-double.cpp
blob470f4dfcb01fd769ac015d194d769da2818c9803
1 // RUN: %clang_cc1 -triple powerpc-ibm-aix-xcoff -fdump-record-layouts \
2 // RUN: -fsyntax-only %s | \
3 // RUN: FileCheck %s
5 // RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fdump-record-layouts \
6 // RUN: -fsyntax-only %s | \
7 // RUN: FileCheck %s
9 struct Empty {};
11 struct A {
12 double d;
15 // CHECK: *** Dumping AST Record Layout
16 // CHECK-NEXT: 0 | struct Empty (empty)
17 // CHECK-NEXT: | [sizeof=1, dsize=1, align=1, preferredalign=1,
18 // CHECK-NEXT: | nvsize=1, nvalign=1, preferrednvalign=1]
20 // CHECK: *** Dumping AST Record Layout
21 // CHECK-NEXT: 0 | struct A
22 // CHECK-NEXT: 0 | double d
23 // CHECK-NEXT: | [sizeof=8, dsize=8, align=4, preferredalign=8,
24 // CHECK-NEXT: | nvsize=8, nvalign=4, preferrednvalign=8]
26 struct B {
27 ~B();
29 Empty emp;
30 A a;
31 char c;
34 struct B1 {
35 [[no_unique_address]] B b;
36 char ext[7];
39 // CHECK: *** Dumping AST Record Layout
40 // CHECK-NEXT: 0 | struct B
41 // CHECK-NEXT: 0 | struct Empty emp (empty)
42 // CHECK-NEXT: 4 | struct A a
43 // CHECK-NEXT: 4 | double d
44 // CHECK-NEXT: 12 | char c
45 // CHECK-NEXT: | [sizeof=16, dsize=13, align=4, preferredalign=4,
46 // CHECK-NEXT: | nvsize=13, nvalign=4, preferrednvalign=4]
48 // CHECK: *** Dumping AST Record Layout
49 // CHECK-NEXT: 0 | struct B1
50 // CHECK-NEXT: 0 | struct B b
51 // CHECK-NEXT: 0 | struct Empty emp (empty)
52 // CHECK-NEXT: 4 | struct A a
53 // CHECK-NEXT: 4 | double d
54 // CHECK-NEXT: 12 | char c
55 // CHECK-NEXT: 13 | char[7] ext
56 // CHECK-NEXT: | [sizeof=20, dsize=20, align=4, preferredalign=4,
57 // CHECK-NEXT: | nvsize=20, nvalign=4, preferrednvalign=4]
59 struct C {
60 ~C();
62 [[no_unique_address]] Empty emp;
63 A a;
64 char c;
67 struct C1 {
68 [[no_unique_address]] C c;
69 char ext[7];
72 // CHECK: *** Dumping AST Record Layout
73 // CHECK-NEXT: 0 | struct C
74 // CHECK-NEXT: 0 | struct Empty emp (empty)
75 // CHECK-NEXT: 0 | struct A a
76 // CHECK-NEXT: 0 | double d
77 // CHECK-NEXT: 8 | char c
78 // CHECK-NEXT: | [sizeof=16, dsize=9, align=4, preferredalign=8,
79 // CHECK-NEXT: | nvsize=9, nvalign=4, preferrednvalign=8]
81 // CHECK: *** Dumping AST Record Layout
82 // CHECK-NEXT: 0 | struct C1
83 // CHECK-NEXT: 0 | struct C c
84 // CHECK-NEXT: 0 | struct Empty emp (empty)
85 // CHECK-NEXT: 0 | struct A a
86 // CHECK-NEXT: 0 | double d
87 // CHECK-NEXT: 8 | char c
88 // CHECK-NEXT: 9 | char[7] ext
89 // CHECK-NEXT: | [sizeof=16, dsize=16, align=4, preferredalign=8,
90 // CHECK-NEXT: | nvsize=16, nvalign=4, preferrednvalign=8]
92 struct D {
93 ~D();
95 [[no_unique_address]] char notEmp;
96 A a;
97 char c;
100 struct D1 {
101 [[no_unique_address]] D d;
102 char ext[7];
105 // CHECK: *** Dumping AST Record Layout
106 // CHECK-NEXT: 0 | struct D
107 // CHECK-NEXT: 0 | char notEmp
108 // CHECK-NEXT: 4 | struct A a
109 // CHECK-NEXT: 4 | double d
110 // CHECK-NEXT: 12 | char c
111 // CHECK-NEXT: | [sizeof=16, dsize=13, align=4, preferredalign=4,
112 // CHECK-NEXT: | nvsize=13, nvalign=4, preferrednvalign=4]
114 // CHECK: *** Dumping AST Record Layout
115 // CHECK-NEXT: 0 | struct D1
116 // CHECK-NEXT: 0 | struct D d
117 // CHECK-NEXT: 0 | char notEmp
118 // CHECK-NEXT: 4 | struct A a
119 // CHECK-NEXT: 4 | double d
120 // CHECK-NEXT: 12 | char c
121 // CHECK-NEXT: 13 | char[7] ext
122 // CHECK-NEXT: | [sizeof=20, dsize=20, align=4, preferredalign=4,
123 // CHECK-NEXT: | nvsize=20, nvalign=4, preferrednvalign=4]
125 struct E {
126 [[no_unique_address]] Empty emp;
127 int : 0;
128 double d;
131 // CHECK: *** Dumping AST Record Layout
132 // CHECK-NEXT: 0 | struct E
133 // CHECK-NEXT: 0 | struct Empty emp (empty)
134 // CHECK-NEXT: 0:- | int
135 // CHECK-NEXT: 0 | double d
136 // CHECK-NEXT: | [sizeof=8, dsize=8, align=4, preferredalign=4,
137 // CHECK-NEXT: | nvsize=8, nvalign=4, preferrednvalign=4]
139 struct F {
140 [[no_unique_address]] Empty emp, emp2;
141 double d;
144 // CHECK: *** Dumping AST Record Layout
145 // CHECK-NEXT: 0 | struct F
146 // CHECK-NEXT: 0 | struct Empty emp (empty)
147 // CHECK-NEXT: 1 | struct Empty emp2 (empty)
148 // CHECK-NEXT: 0 | double d
149 // CHECK-NEXT: | [sizeof=8, dsize=8, align=4, preferredalign=8,
150 // CHECK-NEXT: | nvsize=8, nvalign=4, preferrednvalign=8]
152 int a = sizeof(Empty);
153 int b = sizeof(A);
154 int c = sizeof(B1);
155 int d = sizeof(C1);
156 int e = sizeof(D1);
157 int f = sizeof(E);
158 int g = sizeof(F);