[Lldb-commits] [lldb] r300670 - Fix TestRegisterVariables for clang/arm
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 19 03:13:30 PDT 2017
Author: labath
Date: Wed Apr 19 05:13:29 2017
New Revision: 300670
URL: http://llvm.org/viewvc/llvm-project?rev=300670&view=rev
Log:
Fix TestRegisterVariables for clang/arm
Clang rejects __attribute__((regparm)) when targetting arm. The default
calling convention passes arguments in registers anyway, so we can just
remove them in this case.
Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/test.c
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=300670&r1=300669&r2=300670&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 Wed Apr 19 05:13:29 2017
@@ -1,17 +1,26 @@
#include <stdio.h>
+#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;
More information about the lldb-commits
mailing list