3 // RUN: %clangxx_host -gdwarf -o %t %s
5 // RUN: -o "expr alignof(base)" \
6 // RUN: -o "expr alignof(packed_base)" \
7 // RUN: -o "expr alignof(derived)" \
8 // RUN: -o "expr sizeof(derived)" \
9 // RUN: -o exit | FileCheck %s
11 struct __attribute__((packed
)) packed
{
17 // LLDB incorrectly calculates alignof(base)
19 struct base
: foo
{ int x
; };
20 static_assert(alignof(base
) == 4);
22 // CHECK: (lldb) expr alignof(base)
23 // CHECK-NEXT: ${{.*}} = 4
25 // LLDB incorrectly calculates alignof(packed_base)
26 struct __attribute__((packed
)) packed_base
{ int x
; };
27 static_assert(alignof(packed_base
) == 1);
29 // CHECK: (lldb) expr alignof(packed_base)
30 // CHECK-NEXT: ${{.*}} = 1
32 struct derived
: packed
, packed_base
{
35 static_assert(alignof(derived
) == 2);
36 static_assert(sizeof(derived
) == 16);
38 // CHECK: (lldb) expr alignof(derived)
39 // CHECK-NEXT: ${{.*}} = 2
40 // CHECK: (lldb) expr sizeof(derived)
41 // CHECK-NEXT: ${{.*}} = 16