2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr80334.C
blobaee154876367302cdec222ac774519a737bed70d
1 // { dg-do run }
3 struct A { alignas(16) char c; };
4 struct B { A unpacked; char d; } __attribute__((packed));
6 char x;
8 int
9 main()
11   alignas(__BIGGEST_ALIGNMENT__) B b[3];
12   for (int i = 0; i < 3; i++) b[i].unpacked.c = 'a' + i;
13   for (int i = 0; i < 3; i++)
14     {
15       auto a = new A(b[i].unpacked);
16       x = a->c;
17     }