2020-06-02 23:51:58 +08:00
|
|
|
// RUN: %clang_cc1 -triple powerpc-ibm-aix-xcoff -Wpacked \
|
|
|
|
// RUN: -fdump-record-layouts -fsyntax-only -verify -x c++ < %s | \
|
|
|
|
// RUN: FileCheck %s
|
|
|
|
|
|
|
|
// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -Wpacked \
|
|
|
|
// RUN: -fdump-record-layouts -fsyntax-only -verify -x c++ < %s | \
|
|
|
|
// RUN: FileCheck %s
|
|
|
|
|
|
|
|
struct A {
|
|
|
|
double d;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct B {
|
|
|
|
char x[8];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct [[gnu::packed]] C : B, A { // expected-warning{{packed attribute is unnecessary for 'C'}}
|
|
|
|
char x alignas(4)[8];
|
|
|
|
};
|
|
|
|
|
|
|
|
int b = sizeof(C);
|
|
|
|
|
|
|
|
// CHECK: 0 | struct C
|
|
|
|
// CHECK-NEXT: 0 | struct B (base)
|
2021-10-15 05:52:47 +08:00
|
|
|
// CHECK-NEXT: 0 | char[8] x
|
2020-06-02 23:51:58 +08:00
|
|
|
// CHECK-NEXT: 8 | struct A (base)
|
|
|
|
// CHECK-NEXT: 8 | double d
|
2021-10-15 05:52:47 +08:00
|
|
|
// CHECK-NEXT: 16 | char[8] x
|
2020-06-02 23:51:58 +08:00
|
|
|
// CHECK-NEXT: | [sizeof=24, dsize=24, align=4, preferredalign=4,
|
|
|
|
// CHECK-NEXT: | nvsize=24, nvalign=4, preferrednvalign=4]
|