llvm-project/clang/test/Layout/aix-pack-attr-on-base.cpp
Xiangling Liao 05ad8e9429 [AIX] Implement AIX special alignment rule about double/long double
Implement AIX default `power` alignment rule by adding `PreferredAlignment` and
`PreferredNVAlignment` in ASTRecordLayout class.

The patchh aims at returning correct value for `__alignof(x)` and `alignof(x)`
under `power` alignment rules.

Differential Revision: https://reviews.llvm.org/D79719
2020-07-27 15:13:03 -04:00

21 lines
407 B
C++

// RUN: %clang_cc1 -emit-llvm -triple powerpc-ibm-aix-xcoff -x c++ < %s | \
// RUN: FileCheck %s
// RUN: %clang_cc1 -emit-llvm -triple powerpc64-ibm-aix-xcoff -x c++ < %s | \
// RUN: FileCheck %s
struct A {
char x;
};
struct B {
int x;
};
struct __attribute__((__packed__)) C : A, B {} c;
int s = sizeof(c);
// CHECK: @c = global %struct.C zeroinitializer, align 1
// CHECK: @s = global i32 5