[Lldb-commits] [lldb] r267616 - Fix TestRegisterVariables.py on Windows

Adrian McCarthy via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 26 15:25:41 PDT 2016

Author: amccarth
Date: Tue Apr 26 17:25:40 2016
New Revision: 267616

URL: http://llvm.org/viewvc/llvm-project?rev=267616&view=rev
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


Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/test.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/test.c?rev=267616&r1=267615&r2=267616&view=diff
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/test.c (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/test.c Tue Apr 26 17:25:40 2016
@@ -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;

More information about the lldb-commits mailing list