/* Define several variants of a struct for which the alignment differs
|
/* Define several variants of a struct for which the alignment differs
|
between powerpc64-linux and powerpc64-aix. This might be interesting
|
between powerpc64-linux and powerpc64-aix. This might be interesting
|
for other targets as well. */
|
for other targets as well. */
|
|
|
#define DESC_orig "original"
|
#define DESC_orig "original"
|
struct B1_orig {
|
struct B1_orig {
|
char c;
|
char c;
|
double d;
|
double d;
|
};
|
};
|
|
|
struct A2_orig {
|
struct A2_orig {
|
double d;
|
double d;
|
};
|
};
|
|
|
struct B2_orig {
|
struct B2_orig {
|
char c;
|
char c;
|
struct A2_orig a2;
|
struct A2_orig a2;
|
};
|
};
|
|
|
struct A3_orig {
|
struct A3_orig {
|
double d;
|
double d;
|
int i;
|
int i;
|
};
|
};
|
|
|
struct B3_orig {
|
struct B3_orig {
|
char c;
|
char c;
|
struct A3_orig a3;
|
struct A3_orig a3;
|
};
|
};
|
|
|
#ifndef SKIP_ATTRIBUTE
|
#ifndef SKIP_ATTRIBUTE
|
#define DESC_p_all "packed attribute for all"
|
#define DESC_p_all "packed attribute for all"
|
struct B1_p_all {
|
struct B1_p_all {
|
char c;
|
char c;
|
double d;
|
double d;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct A2_p_all {
|
struct A2_p_all {
|
double d;
|
double d;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct B2_p_all {
|
struct B2_p_all {
|
char c;
|
char c;
|
struct A2_p_all a2;
|
struct A2_p_all a2;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct A3_p_all {
|
struct A3_p_all {
|
double d;
|
double d;
|
int i;
|
int i;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct B3_p_all {
|
struct B3_p_all {
|
char c;
|
char c;
|
struct A3_p_all a3;
|
struct A3_p_all a3;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
#define DESC_p_inner "packed attribute for inner"
|
#define DESC_p_inner "packed attribute for inner"
|
struct B1_p_inner {
|
struct B1_p_inner {
|
char c;
|
char c;
|
double d;
|
double d;
|
};
|
};
|
|
|
struct A2_p_inner {
|
struct A2_p_inner {
|
double d;
|
double d;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct B2_p_inner {
|
struct B2_p_inner {
|
char c;
|
char c;
|
struct A2_p_inner a2;
|
struct A2_p_inner a2;
|
};
|
};
|
|
|
struct A3_p_inner {
|
struct A3_p_inner {
|
double d;
|
double d;
|
int i;
|
int i;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct B3_p_inner {
|
struct B3_p_inner {
|
char c;
|
char c;
|
struct A3_p_inner a3;
|
struct A3_p_inner a3;
|
};
|
};
|
|
|
#define DESC_p_outer "packed attribute for outer"
|
#define DESC_p_outer "packed attribute for outer"
|
struct B1_p_outer {
|
struct B1_p_outer {
|
char c;
|
char c;
|
double d;
|
double d;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct A2_p_outer {
|
struct A2_p_outer {
|
double d;
|
double d;
|
};
|
};
|
|
|
struct B2_p_outer {
|
struct B2_p_outer {
|
char c;
|
char c;
|
struct A2_p_outer a2;
|
struct A2_p_outer a2;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct A3_p_outer {
|
struct A3_p_outer {
|
double d;
|
double d;
|
int i;
|
int i;
|
};
|
};
|
|
|
struct B3_p_outer {
|
struct B3_p_outer {
|
char c;
|
char c;
|
struct A3_p_outer a3;
|
struct A3_p_outer a3;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
#define DESC_a_max "maximum useful struct alignment for all"
|
#define DESC_a_max "maximum useful struct alignment for all"
|
struct B1_a_max {
|
struct B1_a_max {
|
char c;
|
char c;
|
double d;
|
double d;
|
} __attribute__ ((aligned));
|
} __attribute__ ((aligned));
|
|
|
struct A2_a_max {
|
struct A2_a_max {
|
double d;
|
double d;
|
} __attribute__ ((aligned));
|
} __attribute__ ((aligned));
|
|
|
struct B2_a_max {
|
struct B2_a_max {
|
char c;
|
char c;
|
struct A2_a_max a2;
|
struct A2_a_max a2;
|
} __attribute__ ((aligned));
|
} __attribute__ ((aligned));
|
|
|
struct A3_a_max {
|
struct A3_a_max {
|
double d;
|
double d;
|
int i;
|
int i;
|
} __attribute__ ((aligned));
|
} __attribute__ ((aligned));
|
|
|
struct B3_a_max {
|
struct B3_a_max {
|
char c;
|
char c;
|
struct A3_a_max a3;
|
struct A3_a_max a3;
|
} __attribute__ ((aligned));
|
} __attribute__ ((aligned));
|
|
|
#define DESC_m_outer_p_inner "maximum alignment for outer, packed inner"
|
#define DESC_m_outer_p_inner "maximum alignment for outer, packed inner"
|
struct B1_m_outer_p_inner {
|
struct B1_m_outer_p_inner {
|
char c;
|
char c;
|
double d;
|
double d;
|
} __attribute__ ((aligned)) __attribute__ ((packed));
|
} __attribute__ ((aligned)) __attribute__ ((packed));
|
|
|
struct A2_m_outer_p_inner {
|
struct A2_m_outer_p_inner {
|
double d;
|
double d;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct B2_m_outer_p_inner {
|
struct B2_m_outer_p_inner {
|
char c;
|
char c;
|
struct A2_m_outer_p_inner a2;
|
struct A2_m_outer_p_inner a2;
|
} __attribute__ ((aligned));
|
} __attribute__ ((aligned));
|
|
|
struct A3_m_outer_p_inner {
|
struct A3_m_outer_p_inner {
|
double d;
|
double d;
|
int i;
|
int i;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct B3_m_outer_p_inner {
|
struct B3_m_outer_p_inner {
|
char c;
|
char c;
|
struct A3_m_outer_p_inner a3;
|
struct A3_m_outer_p_inner a3;
|
} __attribute__ ((aligned));
|
} __attribute__ ((aligned));
|
|
|
#define DESC_m_inner_p_outer "maximum alignment for inner, packed outer"
|
#define DESC_m_inner_p_outer "maximum alignment for inner, packed outer"
|
struct B1_m_inner_p_outer {
|
struct B1_m_inner_p_outer {
|
char c;
|
char c;
|
double d;
|
double d;
|
} __attribute__ ((aligned)) __attribute__ ((packed));
|
} __attribute__ ((aligned)) __attribute__ ((packed));
|
|
|
struct A2_m_inner_p_outer {
|
struct A2_m_inner_p_outer {
|
double d;
|
double d;
|
} __attribute__ ((aligned));
|
} __attribute__ ((aligned));
|
|
|
struct B2_m_inner_p_outer {
|
struct B2_m_inner_p_outer {
|
char c;
|
char c;
|
struct A2_m_inner_p_outer a2;
|
struct A2_m_inner_p_outer a2;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
|
|
struct A3_m_inner_p_outer {
|
struct A3_m_inner_p_outer {
|
double d;
|
double d;
|
int i;
|
int i;
|
} __attribute__ ((aligned));
|
} __attribute__ ((aligned));
|
|
|
struct B3_m_inner_p_outer {
|
struct B3_m_inner_p_outer {
|
char c;
|
char c;
|
struct A3_m_inner_p_outer a3;
|
struct A3_m_inner_p_outer a3;
|
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
#endif
|
#endif
|
|
|