1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -w -fblocks -triple i386-pc-linux-gnu -target-cpu pentium4 -emit-llvm -o %t %s
2*f4a2713aSLionel Sambuc // RUN: FileCheck < %t %s
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc // CHECK-LABEL: define void @f56(
5*f4a2713aSLionel Sambuc // CHECK: i8 signext %a0, %struct.s56_0* byval align 4 %a1,
6*f4a2713aSLionel Sambuc // CHECK: i64 %a2.coerce, %struct.s56_1* byval align 4,
7*f4a2713aSLionel Sambuc // CHECK: <1 x double> %a4, %struct.s56_2* byval align 4,
8*f4a2713aSLionel Sambuc // CHECK: <4 x i32> %a6, %struct.s56_3* byval align 4,
9*f4a2713aSLionel Sambuc // CHECK: <2 x double> %a8, %struct.s56_4* byval align 4,
10*f4a2713aSLionel Sambuc // CHECK: <8 x i32> %a10, %struct.s56_5* byval align 4,
11*f4a2713aSLionel Sambuc // CHECK: <4 x double> %a12, %struct.s56_6* byval align 4)
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuc // CHECK: call void (i32, ...)* @f56_0(i32 1,
14*f4a2713aSLionel Sambuc // CHECK: i32 %{{.*}}, %struct.s56_0* byval align 4 %{{[^ ]*}},
15*f4a2713aSLionel Sambuc // CHECK: i64 %{{[^ ]*}}, %struct.s56_1* byval align 4 %{{[^ ]*}},
16*f4a2713aSLionel Sambuc // CHECK: <1 x double> %{{[^ ]*}}, %struct.s56_2* byval align 4 %{{[^ ]*}},
17*f4a2713aSLionel Sambuc // CHECK: <4 x i32> %{{[^ ]*}}, %struct.s56_3* byval align 4 %{{[^ ]*}},
18*f4a2713aSLionel Sambuc // CHECK: <2 x double> %{{[^ ]*}}, %struct.s56_4* byval align 4 %{{[^ ]*}},
19*f4a2713aSLionel Sambuc // CHECK: <8 x i32> %{{[^ ]*}}, %struct.s56_5* byval align 4 %{{[^ ]*}},
20*f4a2713aSLionel Sambuc // CHECK: <4 x double> %{{[^ ]*}}, %struct.s56_6* byval align 4 %{{[^ ]*}})
21*f4a2713aSLionel Sambuc // CHECK: }
22*f4a2713aSLionel Sambuc //
23*f4a2713aSLionel Sambuc // <rdar://problem/7964854> [i386] clang misaligns long double in structures
24*f4a2713aSLionel Sambuc // when passed byval
25*f4a2713aSLionel Sambuc // <rdar://problem/8431367> clang misaligns parameters on stack
26*f4a2713aSLionel Sambuc typedef int __attribute__((vector_size (8))) t56_v2i;
27*f4a2713aSLionel Sambuc typedef double __attribute__((vector_size (8))) t56_v1d;
28*f4a2713aSLionel Sambuc typedef int __attribute__((vector_size (16))) t56_v4i;
29*f4a2713aSLionel Sambuc typedef double __attribute__((vector_size (16))) t56_v2d;
30*f4a2713aSLionel Sambuc typedef int __attribute__((vector_size (32))) t56_v8i;
31*f4a2713aSLionel Sambuc typedef double __attribute__((vector_size (32))) t56_v4d;
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambuc struct s56_0 { char a; };
34*f4a2713aSLionel Sambuc struct s56_1 { t56_v2i a; };
35*f4a2713aSLionel Sambuc struct s56_2 { t56_v1d a; };
36*f4a2713aSLionel Sambuc struct s56_3 { t56_v4i a; };
37*f4a2713aSLionel Sambuc struct s56_4 { t56_v2d a; };
38*f4a2713aSLionel Sambuc struct s56_5 { t56_v8i a; };
39*f4a2713aSLionel Sambuc struct s56_6 { t56_v4d a; };
40*f4a2713aSLionel Sambuc
f56(char a0,struct s56_0 a1,t56_v2i a2,struct s56_1 a3,t56_v1d a4,struct s56_2 a5,t56_v4i a6,struct s56_3 a7,t56_v2d a8,struct s56_4 a9,t56_v8i a10,struct s56_5 a11,t56_v4d a12,struct s56_6 a13)41*f4a2713aSLionel Sambuc void f56(char a0, struct s56_0 a1,
42*f4a2713aSLionel Sambuc t56_v2i a2, struct s56_1 a3,
43*f4a2713aSLionel Sambuc t56_v1d a4, struct s56_2 a5,
44*f4a2713aSLionel Sambuc t56_v4i a6, struct s56_3 a7,
45*f4a2713aSLionel Sambuc t56_v2d a8, struct s56_4 a9,
46*f4a2713aSLionel Sambuc t56_v8i a10, struct s56_5 a11,
47*f4a2713aSLionel Sambuc t56_v4d a12, struct s56_6 a13) {
48*f4a2713aSLionel Sambuc extern void f56_0(int x, ...);
49*f4a2713aSLionel Sambuc f56_0(1, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
50*f4a2713aSLionel Sambuc a10, a11, a12, a13);
51*f4a2713aSLionel Sambuc }
52