1 // REQUIRES: arm-registered-target
2 // RUN: %clang_cc1 -triple arm-none-none-eabi \
4 // RUN: -target-cpu cortex-a8 \
5 // RUN: -emit-llvm -o - %s | FileCheck %s
9 // Base case, nothing interesting.
15 void f0m(int, int, int, int, int, S
);
19 f0m(1, 2, 3, 4, 5, s
);
21 // CHECK: define{{.*}} void @g0
22 // CHECK: call void @f0(i32 noundef 1, [2 x i32] [i32 6, i32 7]
23 // CHECK: call void @f0m(i32 noundef 1, i32 noundef 2, i32 noundef 3, i32 noundef 4, i32 noundef 5, [2 x i32] [i32 6, i32 7]
24 // CHECK: declare void @f0(i32 noundef, [2 x i32])
25 // CHECK: declare void @f0m(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, [2 x i32])
27 // Aligned struct, passed according to its natural alignment.
28 struct __attribute__((aligned(8))) S8
{
33 void f1m(int, int, int, int, int, S8
);
37 f1m(1, 2, 3, 4, 5, s
);
39 // CHECK: define{{.*}} void @g1
40 // CHECK: call void @f1(i32 noundef 1, [2 x i32] [i32 6, i32 7]
41 // CHECK: call void @f1m(i32 noundef 1, i32 noundef 2, i32 noundef 3, i32 noundef 4, i32 noundef 5, [2 x i32] [i32 6, i32 7]
42 // CHECK: declare void @f1(i32 noundef, [2 x i32])
43 // CHECK: declare void @f1m(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, [2 x i32])
45 // Aligned struct, passed according to its natural alignment.
46 struct alignas(16) S16
{
50 extern "C" void f2(int, S16
);
51 extern "C" void f2m(int, int, int, int, int, S16
);
56 f2m(1, 2, 3, 4, 5, s
);
58 // CHECK: define{{.*}} void @g2
59 // CHECK: call void @f2(i32 noundef 1, [4 x i32] [i32 6, i32 7
60 // CHECK: call void @f2m(i32 noundef 1, i32 noundef 2, i32 noundef 3, i32 noundef 4, i32 noundef 5, [4 x i32] [i32 6, i32 7
61 // CHECK: declare void @f2(i32 noundef, [4 x i32])
62 // CHECK: declare void @f2m(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, [4 x i32])
64 // Increased natural alignment.
66 int x
__attribute__((aligned(8)));
71 void f3m(int, int, int, int, int, SF8
);
75 f3m(1, 2, 3, 4, 5, s
);
77 // CHECK: define{{.*}} void @g3
78 // CHECK: call void @f3(i32 noundef 1, [1 x i64] [i64 30064771078]
79 // CHECK: call void @f3m(i32 noundef 1, i32 noundef 2, i32 noundef 3, i32 noundef 4, i32 noundef 5, [1 x i64] [i64 30064771078]
80 // CHECK: declare void @f3(i32 noundef, [1 x i64])
81 // CHECK: declare void @f3m(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, [1 x i64])
83 // Increased natural alignment, capped to 8 though.
87 int z
, a
, b
, c
, d
, e
, f
, g
, h
, i
, j
, k
;
91 void f4m(int, int, int, int, int, SF16
);
95 f4m(1, 2, 3, 4, 5, s
);
97 // CHECK: define{{.*}} void @g4
98 // CHECK: call void @f4(i32 noundef 1, ptr noundef nonnull byval(%struct.SF16) align 8
99 // CHECK: call void @f4m(i32 noundef 1, i32 noundef 2, i32 noundef 3, i32 noundef 4, i32 noundef 5, ptr noundef nonnull byval(%struct.SF16) align 8
100 // CHECK: declare void @f4(i32 noundef, ptr noundef byval(%struct.SF16) align 8)
101 // CHECK: declare void @f4m(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef byval(%struct.SF16) align 8)
104 struct __attribute__((packed
)) P
{
110 void f5m(int, int, int, int, int, P
);
114 f5m(1, 2, 3, 4, 5, s
);
116 // CHECK: define{{.*}} void @g5
117 // CHECK: call void @f5(i32 noundef 1, [3 x i32] [i32 6, i32 7, i32 0])
118 // CHECK: call void @f5m(i32 noundef 1, i32 noundef 2, i32 noundef 3, i32 noundef 4, i32 noundef 5, [3 x i32] [i32 6, i32 7, i32 0])
119 // CHECK: declare void @f5(i32 noundef, [3 x i32])
120 // CHECK: declare void @f5m(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, [3 x i32])
123 // Packed and aligned, alignement causes padding at the end.
124 struct __attribute__((packed
, aligned(8))) P8
{
130 void f6m(int, int, int, int, int, P8
);
134 f6m(1, 2, 3, 4, 5, s
);
136 // CHECK: define{{.*}} void @g6
137 // CHECK: call void @f6(i32 noundef 1, [4 x i32] [i32 6, i32 7, i32 0, i32 undef])
138 // CHECK: call void @f6m(i32 noundef 1, i32 noundef 2, i32 noundef 3, i32 noundef 4, i32 noundef 5, [4 x i32] [i32 6, i32 7, i32 0, i32 undef])
139 // CHECK: declare void @f6(i32 noundef, [4 x i32])
140 // CHECK: declare void @f6m(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, [4 x i32])