forked from OSchip/llvm-project
Fix TestRegisterVariables.py on Windows
Use __attribute__((regparm(x))) to ensure the compiler enregisters at least some arguments when calling functions. Differential Revision: http://reviews.llvm.org/D19548 llvm-svn: 267616
This commit is contained in:
parent
d2d2aa52cd
commit
fd5c9be4bb
|
@ -5,20 +5,20 @@ struct bar {
|
||||||
int m2;
|
int m2;
|
||||||
};
|
};
|
||||||
|
|
||||||
void f1(int a, struct bar *b) __attribute__ ((noinline));
|
void f1(int a, struct bar *b) __attribute__((noinline)) __attribute__((regparm(2)));
|
||||||
void f1(int a, struct bar *b)
|
void f1(int a, struct bar *b)
|
||||||
{
|
{
|
||||||
b->m2 = b->m1 + a; // set breakpoint here
|
b->m2 = b->m1 + a; // set breakpoint here
|
||||||
}
|
}
|
||||||
|
|
||||||
void f2(struct bar *b) __attribute__ ((noinline));
|
void f2(struct bar *b) __attribute__((noinline)) __attribute__((regparm(1)));
|
||||||
void f2(struct bar *b)
|
void f2(struct bar *b)
|
||||||
{
|
{
|
||||||
int c = b->m2;
|
int c = b->m2;
|
||||||
printf("%d\n", c); // set breakpoint here
|
printf("%d\n", c); // set breakpoint here
|
||||||
}
|
}
|
||||||
|
|
||||||
float f3() __attribute__ ((noinline));
|
float f3() __attribute__((noinline));
|
||||||
float f3() {
|
float f3() {
|
||||||
return 3.14f;
|
return 3.14f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue