diff options
author | Stefano Rivera <stefano@rivera.za.net> | 2014-07-24 10:47:07 +0200 |
---|---|---|
committer | Stefano Rivera <stefano@rivera.za.net> | 2014-07-24 10:47:07 +0200 |
commit | cc0d84a0b1ad2b402ea889c2160e1056e04b3357 (patch) | |
tree | 4280752978f027bfa95b9b59bdc3635bc6a4bc67 | |
parent | 22730d98d0ffd67eb9aaa79c1130b9cd97e27a51 (diff) | |
download | cffi-cc0d84a0b1ad2b402ea889c2160e1056e04b3357.tar.gz |
ARM64 support. Tests pass under qemu.
Fixes #136. Thanks Will Newton <will.newton@linaro.org>.
-rw-r--r-- | c/_cffi_backend.c | 2 | ||||
-rw-r--r-- | testing/test_ffi_backend.py | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c index aac6a76..4be4fd2 100644 --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -3622,7 +3622,7 @@ static int complete_sflags(int sflags) #ifdef MS_WIN32 sflags |= SF_MSVC_BITFIELDS; #else -# ifdef __arm__ +# if defined(__arm__) || defined(__aarch64__) sflags |= SF_GCC_ARM_BITFIELDS; # else sflags |= SF_GCC_X86_BITFIELDS; diff --git a/testing/test_ffi_backend.py b/testing/test_ffi_backend.py index ff06929..2518a51 100644 --- a/testing/test_ffi_backend.py +++ b/testing/test_ffi_backend.py @@ -122,7 +122,7 @@ class TestBitfield: self.check("int a:2; short b:15; char c:2; char y;", 5, 4, 8) self.check("int a:2; char b:1; char c:1; char y;", 1, 4, 4) - @pytest.mark.skipif("platform.machine().startswith('arm')") + @pytest.mark.skipif("platform.machine().startswith(('arm', 'aarch64'))") def test_bitfield_anonymous_no_align(self): L = FFI().alignof("long long") self.check("char y; int :1;", 0, 1, 2) @@ -135,7 +135,8 @@ class TestBitfield: self.check("char x; long long z:57; char y;", L + 8, L, L + 8 + L) self.check("char x; long long :57; char y;", L + 8, 1, L + 9) - @pytest.mark.skipif("not platform.machine().startswith('arm')") + @pytest.mark.skipif( + "not platform.machine().startswith(('arm', 'aarch64'))") def test_bitfield_anonymous_align_arm(self): L = FFI().alignof("long long") self.check("char y; int :1;", 0, 4, 4) @@ -148,7 +149,7 @@ class TestBitfield: self.check("char x; long long z:57; char y;", L + 8, L, L + 8 + L) self.check("char x; long long :57; char y;", L + 8, L, L + 8 + L) - @pytest.mark.skipif("platform.machine().startswith('arm')") + @pytest.mark.skipif("platform.machine().startswith(('arm', 'aarch64'))") def test_bitfield_zero(self): L = FFI().alignof("long long") self.check("char y; int :0;", 0, 1, 4) @@ -159,7 +160,8 @@ class TestBitfield: self.check("char x; int :0; short b:1; char y;", 5, 2, 6) self.check("int a:1; int :0; int b:1; char y;", 5, 4, 8) - @pytest.mark.skipif("not platform.machine().startswith('arm')") + @pytest.mark.skipif( + "not platform.machine().startswith(('arm', 'aarch64'))") def test_bitfield_zero_arm(self): L = FFI().alignof("long long") self.check("char y; int :0;", 0, 4, 4) |