brintos

brintos / llvm-project-archived public Read only

0
0
Text · 782 B · c4bcfc4 Raw
31 lines · cpp
1// XFAIL: *2 3// RUN: %clang --target=x86_64-apple-macosx -c -gdwarf -o %t %s4// RUN: %lldb %t \5// RUN:   -o "expr alignof(OverlappingDerived)" \6// RUN:   -o "expr sizeof(OverlappingDerived)" \7// RUN:   -o exit | FileCheck %s8 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: ${{.*}} = 427// CHECK:      (lldb) expr sizeof(OverlappingDerived)28// CHECK-NEXT: ${{.*}} = 429 30int main() { OverlappingDerived d; }31