xref: /llvm-project/clang/test/Layout/aix-type-align-and-pack-attr.cpp (revision c5de4dd1eab00df76c1a68c5f397304ceacb71f2)
1 // RUN: %clang_cc1 -triple powerpc-ibm-aix-xcoff -emit-llvm -x c++ < %s | \
2 // RUN:   FileCheck %s
3 
4 // RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -emit-llvm -x c++ < %s | \
5 // RUN:   FileCheck %s
6 
7 namespace test1 {
8 struct __attribute__((__aligned__(2))) S {
9   double d;
10 };
11 
12 S s;
13 
14 // CHECK: @{{.*}}test1{{.*}}s{{.*}} = global %"struct.test1::S" zeroinitializer, align 8
15 } // namespace test1
16 
17 namespace test2 {
18 struct __attribute__((__aligned__(2), packed)) S {
19   double d;
20 };
21 
22 S s;
23 
24 // CHECK: @{{.*}}test2{{.*}}s{{.*}} = global %"struct.test2::S" zeroinitializer, align 2
25 } // namespace test2
26 
27 namespace test3 {
28 struct __attribute__((__aligned__(16))) S {
29   double d;
30 };
31 
32 S s;
33 
34 // CHECK: @{{.*}}test3{{.*}}s{{.*}} = global %"struct.test3::S" zeroinitializer, align 16
35 } // namespace test3
36 
37 namespace test4 {
38 struct __attribute__((aligned(2))) SS {
39   double d;
40 };
41 
42 struct S {
43   struct SS ss;
44 } s;
45 
46 // CHECK: @{{.*}}test4{{.*}}s{{.*}} = global %"struct.test4::S" zeroinitializer, align 8
47 } // namespace test4
48 
49 namespace test5 {
50 struct __attribute__((aligned(2), packed)) SS {
51   double d;
52 };
53 
54 struct S {
55   struct SS ss;
56 } s;
57 
58 // CHECK: @{{.*}}test5{{.*}}s{{.*}} = global %"struct.test5::S" zeroinitializer, align 2
59 } // namespace test5
60