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