1// XFAIL: *
2
3// RUN: %clang --target=x86_64-apple-macosx -c -gdwarf -o %t %s
4// RUN: %lldb %t \
5// RUN: -o "expr alignof(OverlappingDerived)" \
6// RUN: -o "expr sizeof(OverlappingDerived)" \
7// RUN: -o exit | FileCheck %s
8
9struct Empty {};
10
11struct OverlappingBase {
12 [[no_unique_address]] Empty e;
13};
14static_assert(sizeof(OverlappingBase) == 1);
15static_assert(alignof(OverlappingBase) == 1);
16
17struct Base {
18 int mem;
19};
20
21struct OverlappingDerived : Base, OverlappingBase {};
22static_assert(alignof(OverlappingDerived) == 4);
23static_assert(sizeof(OverlappingDerived) == 4);
24
25// CHECK: (lldb) expr alignof(OverlappingDerived)
26// CHECK-NEXT: ${{.*}} = 4
27// CHECK: (lldb) expr sizeof(OverlappingDerived)
28// CHECK-NEXT: ${{.*}} = 4
29
30int main() { OverlappingDerived d; }
31

source code of lldb/test/Shell/SymbolFile/DWARF/x86/no_unique_address-base-alignment.cpp