Chromium Code Reviews| Index: sandbox/linux/seccomp-bpf/syscall_unittest.cc |
| diff --git a/sandbox/linux/seccomp-bpf/syscall_unittest.cc b/sandbox/linux/seccomp-bpf/syscall_unittest.cc |
| index 38f31e0a58ed5073f0236ec36bd7acca6c1dd5ad..7810a6507a60f472f9ec71b135a12993c5383ed0 100644 |
| --- a/sandbox/linux/seccomp-bpf/syscall_unittest.cc |
| +++ b/sandbox/linux/seccomp-bpf/syscall_unittest.cc |
| @@ -41,7 +41,7 @@ TEST(Syscall, WellKnownEntryPoint) { |
| // Test that Syscall::Call(-1) is handled specially. Don't do this on ARM, |
| // where syscall(-1) crashes with SIGILL. Not running the test is fine, as we |
| // are still testing ARM code in the next set of tests. |
| -#if !defined(__arm__) |
| +#if !defined(__arm__) && !defined(__aarch64__) |
| EXPECT_NE(Syscall::Call(-1), syscall(-1)); |
| #endif |
| @@ -61,6 +61,8 @@ TEST(Syscall, WellKnownEntryPoint) { |
| #elif defined(__mips__) |
| // Opcode for MIPS sycall is in the lower 16-bits |
| EXPECT_EQ(0x0cu, (((uint32_t*)Syscall::Call(-1))[-1]) & 0x0000FFFF); |
| +#elif defined(__aarch64__) |
| + EXPECT_EQ(0xD4000001u, ((uint32_t*)Syscall::Call(-1))[-1]); // SVC 0 |
| #else |
| #warning Incomplete test case; need port for target platform |
| #endif |
| @@ -153,8 +155,12 @@ BPF_TEST(Syscall, |
| TEST(Syscall, ComplexSyscallSixArgs) { |
| int fd; |
| +#if defined(__aarch64__) |
| + ASSERT_LE(0, |
| + fd = Syscall::Call(__NR_openat, AT_FDCWD, "/dev/null", O_RDWR, 0L)); |
|
jln (very slow on Chromium)
2014/08/21 19:04:53
Could we use openat everywhere instead? It should
leecam
2014/08/22 10:44:18
Done.
|
| +#else |
| ASSERT_LE(0, fd = Syscall::Call(__NR_open, "/dev/null", O_RDWR, 0L)); |
| - |
| +#endif |
| // Use mmap() to allocate some read-only memory |
| char* addr0; |
| ASSERT_NE( |
| @@ -186,7 +192,13 @@ TEST(Syscall, ComplexSyscallSixArgs) { |
| // Check that the offset argument (i.e. the sixth argument) is processed |
| // correctly. |
| +#if defined(__aarch64__) |
|
jln (very slow on Chromium)
2014/08/21 19:04:53
Same remark.
leecam
2014/08/22 10:44:18
Done.
|
| + ASSERT_GE( |
| + fd = Syscall::Call(__NR_openat, AT_FDCWD, "/proc/self/exe", O_RDONLY, 0L), |
| + 0); |
| +#else |
| ASSERT_GE(fd = Syscall::Call(__NR_open, "/proc/self/exe", O_RDONLY, 0L), 0); |
| +#endif |
| char* addr2, *addr3; |
| ASSERT_NE((char*)NULL, |
| addr2 = reinterpret_cast<char*>(Syscall::Call( |