aboutsummaryrefslogtreecommitdiff
path: root/tests/sys_procfs_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sys_procfs_test.cpp')
-rw-r--r--tests/sys_procfs_test.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/sys_procfs_test.cpp b/tests/sys_procfs_test.cpp
index 8054869eb..5e0a0b024 100644
--- a/tests/sys_procfs_test.cpp
+++ b/tests/sys_procfs_test.cpp
@@ -18,7 +18,7 @@
#include <sys/procfs.h>
-TEST(sys_procfs, smoke) {
+TEST(sys_procfs, types) {
elf_greg_t reg;
memset(&reg, 0, sizeof(reg));
@@ -37,3 +37,16 @@ TEST(sys_procfs, smoke) {
static_assert(sizeof(prgregset_t) == sizeof(elf_gregset_t), "");
static_assert(sizeof(prfpregset_t) == sizeof(elf_fpregset_t), "");
}
+
+TEST(sys_procfs, constants) {
+ // NGREG != ELF_NGREG (https://github.com/android/ndk/issues/1347)
+ static_assert(sizeof(gregset_t) / sizeof(greg_t) == NGREG);
+
+#if defined(__arm__)
+ static_assert(sizeof(user_regs) / sizeof(elf_greg_t) == ELF_NGREG);
+#elif defined(__aarch64__)
+ static_assert(sizeof(user_pt_regs) / sizeof(elf_greg_t) == ELF_NGREG);
+#else
+ static_assert(sizeof(user_regs_struct) / sizeof(elf_greg_t) == ELF_NGREG);
+#endif
+}