OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / ext / alignof2.C
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
7 extern "C" void abort();
8
9 struct A
10 {
11   double a; 
12 } sa;
13
14 struct B
15 {
16   char c;
17   double b;
18 } sb;
19
20 int main()
21 {
22   if (__alignof (sa) != __alignof (sa.a)
23       || __alignof (sb) != __alignof (sb.b))
24     abort();
25 }