[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / regparm.cpp
blob1fd471c2d0727b5d5da42c3738bc2651b541ad44
1 // RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
4 // CHECK: _Z3fooRi(ptr inreg
5 void __attribute__ ((regparm (1))) foo(int &a) {
8 struct S1 {
9 int x;
10 S1(const S1 &y);
13 void __attribute__((regparm(3))) foo2(S1 a, int b);
14 // CHECK: declare void @_Z4foo22S1i(ptr inreg noundef, i32 inreg noundef)
15 void bar2(S1 a, int b) {
16 foo2(a, b);
19 struct S2 {
20 int x;
23 void __attribute__((regparm(3))) foo3(struct S2 a, int b);
24 // CHECK: declare void @_Z4foo32S2i(i32 inreg, i32 inreg noundef)
25 void bar3(struct S2 a, int b) {
26 foo3(a, b);
29 struct S3 {
30 struct {
31 struct {} b[0];
32 } a;
34 __attribute((regparm(2))) void foo4(S3 a, int b);
35 // CHECK: declare void @_Z4foo42S3i(ptr noundef byval(%struct.S3) align 4, i32 inreg noundef)
36 void bar3(S3 a, int b) {
37 foo4(a, b);