xref: /llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/no_unique_address-alignment.cpp (revision 4e6fa78f4dc8ba01eb63ccaf010f985df6e4a361)
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(OverlappingFields)" \
6 // RUN:   -o "expr sizeof(OverlappingFields)" \
7 // RUN:   -o exit | FileCheck %s
8 
9 // CHECK:      (lldb) expr alignof(OverlappingFields)
10 // CHECK-NEXT: ${{.*}} = 4
11 // CHECK:      (lldb) expr sizeof(OverlappingFields)
12 // CHECK-NEXT: ${{.*}} = 8
13 
14 struct Empty {};
15 
16 struct OverlappingFields {
17   char y;
18   [[no_unique_address]] Empty e;
19   int z;
20 } g_overlapping_struct;
21 static_assert(alignof(OverlappingFields) == 4);
22 static_assert(sizeof(OverlappingFields) == 8);
23 
24 int main() {}
25