150
|
1 // RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
|
|
2
|
|
3
|
236
|
4 // CHECK: _Z3fooRi(ptr inreg
|
150
|
5 void __attribute__ ((regparm (1))) foo(int &a) {
|
|
6 }
|
|
7
|
|
8 struct S1 {
|
|
9 int x;
|
|
10 S1(const S1 &y);
|
|
11 };
|
|
12
|
|
13 void __attribute__((regparm(3))) foo2(S1 a, int b);
|
236
|
14 // CHECK: declare void @_Z4foo22S1i(ptr inreg noundef, i32 inreg noundef)
|
150
|
15 void bar2(S1 a, int b) {
|
|
16 foo2(a, b);
|
|
17 }
|
|
18
|
|
19 struct S2 {
|
|
20 int x;
|
|
21 };
|
|
22
|
|
23 void __attribute__((regparm(3))) foo3(struct S2 a, int b);
|
236
|
24 // CHECK: declare void @_Z4foo32S2i(i32 inreg, i32 inreg noundef)
|
150
|
25 void bar3(struct S2 a, int b) {
|
|
26 foo3(a, b);
|
|
27 }
|
|
28
|
|
29 struct S3 {
|
|
30 struct {
|
|
31 struct {} b[0];
|
|
32 } a;
|
|
33 };
|
|
34 __attribute((regparm(2))) void foo4(S3 a, int b);
|
236
|
35 // CHECK: declare void @_Z4foo42S3i(ptr noundef byval(%struct.S3) align 4, i32 inreg noundef)
|
150
|
36 void bar3(S3 a, int b) {
|
|
37 foo4(a, b);
|
|
38 }
|