summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2017-05-02 13:52:33 +0200
committerLuca Barbato <lu_zero@gentoo.org>2017-06-19 20:10:57 +0200
commit4ee5113d1ebd0fa1318da63c6fd0f5d6972604a3 (patch)
tree83d815eda390e471b908b96f5785cca89616d0b4 /test
parentab5435e8bc9b10ed3dc05787c10d28bb8957a42a (diff)
downloadnix-4ee5113d1ebd0fa1318da63c6fd0f5d6972604a3.zip
Support powerpc64
The test_ioctl values are computed using ioctl-test.c
Diffstat (limited to 'test')
-rw-r--r--test/sys/test_ioctl.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/sys/test_ioctl.rs b/test/sys/test_ioctl.rs
index b68622d1..55b61fd7 100644
--- a/test/sys/test_ioctl.rs
+++ b/test/sys/test_ioctl.rs
@@ -20,7 +20,7 @@ ioctl!(readwrite buf readwritebuf_test with 0, 0; u32);
mod linux {
#[test]
fn test_op_none() {
- if cfg!(any(target_arch = "mips", target_arch="powerpc")){
+ if cfg!(any(target_arch = "mips", target_arch="powerpc", target_arch="powerpc64")){
assert_eq!(io!(b'q', 10), 0x2000710A);
assert_eq!(io!(b'a', 255), 0x200061FF);
} else {
@@ -31,7 +31,7 @@ mod linux {
#[test]
fn test_op_write() {
- if cfg!(any(target_arch = "mips", target_arch="powerpc")){
+ if cfg!(any(target_arch = "mips", target_arch="powerpc", target_arch="powerpc64")){
assert_eq!(iow!(b'z', 10, 1), 0x80017A0A);
assert_eq!(iow!(b'z', 10, 512), 0x82007A0A);
} else {
@@ -43,12 +43,17 @@ mod linux {
#[cfg(target_pointer_width = "64")]
#[test]
fn test_op_write_64() {
- assert_eq!(iow!(b'z', 10, (1 as u64) << 32), 0x40007A0A);
+ if cfg!(any(target_arch="powerpc64")){
+ assert_eq!(iow!(b'z', 10, (1 as u64) << 32), 0x80007A0A);
+ } else {
+ assert_eq!(iow!(b'z', 10, (1 as u64) << 32), 0x40007A0A);
+ }
+
}
#[test]
fn test_op_read() {
- if cfg!(any(target_arch = "mips", target_arch="powerpc")){
+ if cfg!(any(target_arch = "mips", target_arch="powerpc", target_arch="powerpc64")){
assert_eq!(ior!(b'z', 10, 1), 0x40017A0A);
assert_eq!(ior!(b'z', 10, 512), 0x42007A0A);
} else {
@@ -60,7 +65,11 @@ mod linux {
#[cfg(target_pointer_width = "64")]
#[test]
fn test_op_read_64() {
- assert_eq!(ior!(b'z', 10, (1 as u64) << 32), 0x80007A0A);
+ if cfg!(any(target_arch="powerpc64")){
+ assert_eq!(ior!(b'z', 10, (1 as u64) << 32), 0x40007A0A);
+ } else {
+ assert_eq!(ior!(b'z', 10, (1 as u64) << 32), 0x80007A0A);
+ }
}
#[test]