Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Fix TestRegisterVariables.py on Windows
Browse files Browse the repository at this point in the history
Use __attribute__((regparm(x))) to ensure the compiler enregisters at least some arguments when calling functions.

Differential Revision: http://reviews.llvm.org/D19548

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@267616 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
amccarth-google committed Apr 26, 2016
1 parent 57fe881 commit 8384f15
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ struct bar {
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)
{
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)
{
int c = b->m2;
printf("%d\n", c); // set breakpoint here
}

float f3() __attribute__ ((noinline));
float f3() __attribute__((noinline));
float f3() {
return 3.14f;
}
Expand Down

0 comments on commit 8384f15

Please # to comment.