[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Layout / aix-power-alignment-typedef.cpp
blob908415e72e38dc2c7cee4aefb850670793036566
1 // RUN: %clang_cc1 -triple powerpc-ibm-aix-xcoff -fdump-record-layouts %s | \
2 // RUN: FileCheck %s
4 // RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fdump-record-layouts %s | \
5 // RUN: FileCheck %s
7 namespace test1 {
8 typedef double __attribute__((__aligned__(2))) Dbl;
9 struct A {
10 Dbl x;
13 int b = sizeof(A);
15 // CHECK: 0 | struct test1::A
16 // CHECK-NEXT: 0 | Dbl x
17 // CHECK-NEXT: | [sizeof=8, dsize=8, align=2, preferredalign=2,
18 // CHECK-NEXT: | nvsize=8, nvalign=2, preferrednvalign=2]
20 } // namespace test1
22 namespace test2 {
23 typedef double Dbl __attribute__((__aligned__(2)));
24 typedef Dbl DblArr[];
26 union U {
27 DblArr da;
28 char x;
31 int x = sizeof(U);
33 // CHECK: 0 | union test2::U
34 // CHECK-NEXT: 0 | DblArr da
35 // CHECK-NEXT: 0 | char x
36 // CHECK-NEXT: | [sizeof=2, dsize=2, align=2, preferredalign=2,
37 // CHECK-NEXT: | nvsize=2, nvalign=2, preferrednvalign=2]
39 } // namespace test2
41 namespace test3 {
42 typedef double DblArr[] __attribute__((__aligned__(2)));
44 union U {
45 DblArr da;
46 char x;
49 int x = sizeof(U);
51 // CHECK: 0 | union test3::U
52 // CHECK-NEXT: 0 | DblArr da
53 // CHECK-NEXT: 0 | char x
54 // CHECK-NEXT: | [sizeof=2, dsize=2, align=2, preferredalign=2,
55 // CHECK-NEXT: | nvsize=2, nvalign=2, preferrednvalign=2]
57 } // namespace test3
59 namespace test4 {
60 typedef double Dbl __attribute__((__aligned__(2)));
62 union U {
63 Dbl DblArr[];
64 char x;
67 int x = sizeof(U);
69 // CHECK: 0 | union test4::U
70 // CHECK-NEXT: 0 | Dbl[] DblArr
71 // CHECK-NEXT: 0 | char x
72 // CHECK-NEXT: | [sizeof=2, dsize=2, align=2, preferredalign=2,
73 // CHECK-NEXT: | nvsize=2, nvalign=2, preferrednvalign=2]
75 } // namespace test4