1// PRs 16387 and 16389 2// We were treating alignof (sa.a) as alignof (typeof (sa.a)), which is 3// wrong for some fields. 4 5// { dg-do run } 6 7extern "C" void abort(); 8 9struct A 10{ 11 double a; 12} sa; 13 14struct B 15{ 16 char c; 17 double b; 18} sb; 19 20int main() 21{ 22 if (__alignof (sa) != __alignof (sa.a) 23 || __alignof (sb) != __alignof (sb.b)) 24 abort(); 25} 26