diff options
| author | Pavel Labath <labath@google.com> | 2017-04-19 10:13:29 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-04-19 10:13:29 +0000 |
| commit | 7c437023cac591f39ea09bfc75cbb9e5f0d5e38c (patch) | |
| tree | 976b7faabc718c545849738ac8d501a0ab411144 /lldb/packages/Python/lldbsuite/test | |
| parent | 107e694271b5b2679136de194f461c1b6c33463f (diff) | |
| download | bcm5719-llvm-7c437023cac591f39ea09bfc75cbb9e5f0d5e38c.tar.gz bcm5719-llvm-7c437023cac591f39ea09bfc75cbb9e5f0d5e38c.zip | |
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.
llvm-svn: 300670
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
| -rw-r--r-- | lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c b/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c index 476c32899ed..b95253ef9ee 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c +++ b/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c @@ -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; |

