mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 10:16:06 +00:00

constructors. When I first moved regparm support to TargetInfo.cpp I tried to isolate it in classifyArgumentTypeWithReg, but it is actually a lot easier to flip the code around and check for regparm at the end of the decision tree. Without this refactoring classifyArgumentTypeWithReg would have to duplicate the logic about when to use non-byval indirect arguments. llvm-svn: 166266
28 lines
562 B
C++
28 lines
562 B
C++
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
|
|
|
|
|
|
// CHECK: _Z3fooRi(i32* inreg
|
|
void __attribute__ ((regparm (1))) foo(int &a) {
|
|
}
|
|
|
|
struct S1 {
|
|
int x;
|
|
S1(const S1 &y);
|
|
};
|
|
|
|
void __attribute__((regparm(3))) foo2(S1 a, int b);
|
|
// CHECK: declare void @_Z4foo22S1i(%struct.S1* inreg, i32 inreg)
|
|
void bar2(S1 a, int b) {
|
|
foo2(a, b);
|
|
}
|
|
|
|
struct S2 {
|
|
int x;
|
|
};
|
|
|
|
void __attribute__((regparm(3))) foo3(struct S2 a, int b);
|
|
// declare void @_Z4foo12S1i(i32 inreg, i32 inreg) optsize
|
|
void bar3(struct S2 a, int b) {
|
|
foo3(a, b);
|
|
}
|