From d44a35e87e405ae98902dc491ba70ed82f58f592 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 20 Apr 2017 21:21:28 +0000 Subject: Vendor import of lldb trunk r300890: https://llvm.org/svn/llvm-project/lldb/trunk@300890 --- .../Python/lldbsuite/test/lang/c/register_variables/test.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'packages/Python/lldbsuite/test/lang/c') diff --git a/packages/Python/lldbsuite/test/lang/c/register_variables/test.c b/packages/Python/lldbsuite/test/lang/c/register_variables/test.c index 476c32899edc..b95253ef9eea 100644 --- a/packages/Python/lldbsuite/test/lang/c/register_variables/test.c +++ b/packages/Python/lldbsuite/test/lang/c/register_variables/test.c @@ -1,17 +1,26 @@ #include +#if defined(__arm__) || defined(__aarch64__) +// Clang does not accept regparm attribute on these platforms. +// Fortunately, the default calling convention passes arguments in registers +// anyway. +#define REGPARM(N) +#else +#define REGPARM(N) __attribute__((regparm(N))) +#endif + struct bar { int m1; int m2; }; -void f1(int a, struct bar *b) __attribute__((noinline)) __attribute__((regparm(2))); +void f1(int a, struct bar *b) __attribute__((noinline)) REGPARM(2); void f1(int a, struct bar *b) { b->m2 = b->m1 + a; // set breakpoint here } -void f2(struct bar *b) __attribute__((noinline)) __attribute__((regparm(1))); +void f2(struct bar *b) __attribute__((noinline)) REGPARM(1); void f2(struct bar *b) { int c = b->m2; -- cgit v1.2.3