1 // RUN: %clang_cc1 -emit-llvm-only -triple s390x-none-zos -fdump-record-layouts %s | FileCheck %s --check-prefix=CHECK
2 // RUN: %clang_cc1 -emit-llvm -triple s390x-none-zos %s -o - | FileCheck %s --check-prefix=DECL
4 static int __attribute__((aligned(32))) v0
;
5 int __attribute__((aligned(32))) v1
;
6 typedef int __attribute__((aligned(32))) int32
;
9 int f0(void) { return v0
+ v1
+ v2
+ v3
; }
10 // DECL: @v0 {{.*}} align 16
11 // DECL-NEXT: @v1 {{.*}} align 32
12 // DECL-NEXT: @v2 {{.*}} align 16
13 // DECL-NEXT: @v3 {{.*}} align 32
19 // CHECK: 0 | struct cs0
20 // CHECK-NEXT: 0:- | unsigned long
21 // CHECK-NEXT: 0 | long long a
22 // CHECK-NEXT: | [sizeof=8, align=8]
28 // CHECK: 0 | struct vs0
29 // CHECK-NEXT: 0:- | long
30 // CHECK-NEXT: 0 | short a
31 // CHECK-NEXT: | [sizeof=2, align=2]
40 // CHECK: 0 | struct s0
41 // CHECK-NEXT: 0:0-2 | short a
42 // CHECK-NEXT: 0:3-7 | long b
43 // CHECK-NEXT: 1:0-0 | int c
44 // CHECK-NEXT: 1:1-10 | long d
45 // CHECK-NEXT: 2:3-7 | char e
46 // CHECK-NEXT: | [sizeof=3, align=1]
53 // CHECK: 0 | struct s1
54 // CHECK-NEXT: 0:0-6 | char a
55 // CHECK-NEXT: 0:7-33 | long b
56 // CHECK-NEXT: 4:2-3 | int c
57 // CHECK-NEXT: | [sizeof=5, align=1]
65 // CHECK: 0 | struct s2
66 // CHECK-NEXT: 0:0-6 | char a
67 // CHECK-NEXT: 4:- | char
68 // CHECK-NEXT: 4:- | short
69 // CHECK-NEXT: 4:- | short
70 // CHECK-NEXT: | [sizeof=4, align=4]
78 // CHECK: 0 | struct s3
79 // CHECK-NEXT: 0 | int a
80 // CHECK-NEXT: 4:0-15 | int b
81 // CHECK-NEXT: 8:- | char
82 // CHECK-NEXT: 8:0-0 | char c
83 // CHECK-NEXT: | [sizeof=12, align=4]
86 unsigned int __attribute__((aligned(32))) a
;
88 // CHECK: 0 | struct s4
89 // CHECK-NEXT: 0 | unsigned int a
90 // CHECK-NEXT: | [sizeof=32, align=32]
94 int b
: 19 __attribute__((aligned(4)));
95 int c
: 22 __attribute__((aligned(8)));
99 // CHECK: 0 | struct s5
100 // CHECK-NEXT: 0 | char a
101 // CHECK-NEXT: 4:0-18 | int b
102 // CHECK-NEXT: 8:0-21 | int c
103 // CHECK-NEXT: 12:- | int
104 // CHECK-NEXT: 12:0-9 | int d
105 // CHECK-NEXT: | [sizeof=16, align=8]
111 // CHECK: 0 | struct s6
112 // CHECK-NEXT: 0 | char * a
113 // CHECK-NEXT: 8 | char *[] b
114 // CHECK-NEXT: | [sizeof=8, align=8]
120 // CHECK: 0 | struct s7
121 // CHECK-NEXT: 0:- | long
122 // CHECK-NEXT: 0 | short a
123 // CHECK-NEXT: | [sizeof=2, align=2]
131 // CHECK: 0 | struct s8
132 // CHECK-NEXT: 0:- | unsigned long
133 // CHECK-NEXT: 0 | long long a
134 // CHECK-NEXT: | [sizeof=8, align=2]
140 // CHECK: 0 | struct s9
141 // CHECK-NEXT: 0:- | unsigned int
142 // CHECK-NEXT: 0:- | unsigned short
143 // CHECK-NEXT: | [sizeof=0, align=1]
146 unsigned int __attribute__((aligned
)) a
;
148 // CHECK: 0 | struct s10
149 // CHECK-NEXT: 0 | unsigned int a
150 // CHECK-NEXT: | [sizeof=8, align=8]
157 // CHECK: 0 | struct s11
158 // CHECK-NEXT: 0 | char a
159 // CHECK-NEXT: 8:- | long
160 // CHECK-NEXT: 8 | char b
161 // CHECK-NEXT: | [sizeof=16, align=8]
166 // CHECK: 0 | struct s12
167 // CHECK-NEXT: 0 | __int128_t a
168 // CHECK-NEXT: | [sizeof=16, align=8]
171 unsigned short d1
__attribute__((packed
));
174 } U0
__attribute__((aligned(8)));
175 // CHECK: 0 | union u0
176 // CHECK-NEXT: 0 | unsigned short d1
177 // CHECK-NEXT: 0:0-9 | int d2
178 // CHECK-NEXT: 0 | long d3
179 // CHECK-NEXT: | [sizeof=8, align=8]
185 // CHECK: 0 | union u1
186 // CHECK-NEXT: 0:- | unsigned int
187 // CHECK-NEXT: 0 | short a
188 // CHECK-NEXT: | [sizeof=4, align=4]
194 // CHECK: 0 | union u2
195 // CHECK-NEXT: 0:- | long
196 // CHECK-NEXT: 0 | short a
197 // CHECK-NEXT: | [sizeof=8, align=8]
203 // CHECK: 0 | union u3
204 // CHECK-NEXT: 0:- | unsigned char
205 // CHECK-NEXT: 0:- | unsigned short
206 // CHECK-NEXT: | [sizeof=0, align=4]