The "aligned" attribute can only increase the alignment of a struct, or struct member, unless it's used together with the "packed" attribute, or used as a part of a typedef, in which case, the "aligned" attribute can both increase and decrease alignment.
That said, we expect:
- "aligned" attribute alone: does not interfere with the alignment upgrade instrumented by the AIX "power" alignment rule,
- "aligned" attribute + typedef: overrides any computed alignment,
- "aligned" attribute + "packed" attribute: overrides any computed alignment.
The old implementation achieved 2 and 3, but didn't get 1 right, in that any field marked attribute "aligned" would not go through the alignment upgrade.
Minor nit: I think the other test can live in this file, highlighting the difference between the 2 cases is nice. Also I think we should add a typedef test in here as well.