#include "tests/sys_mman.h"
#include <unistd.h>
-/*
- * Division by zero triggers a SIGFPE on x86 and x86_64,
- * but not on the PowerPC architecture.
+/* Division by zero triggers a SIGFPE on x86 and x86_64,
+ but not on the PowerPC architecture.
+
+ On ARM-Linux, we do get a SIGFPE, but not from the faulting of a
+ division instruction (there isn't any such thing) but rather
+ because the process exits via tgkill, sending itself a SIGFPE.
+ Hence we get a SIGFPE but the SI_CODE is different from that on
+ x86/amd64-linux.
*/
#if defined(__powerpc__)
-#define DIVISION_BY_ZERO_TRIGGERS_FPE 0
-#define DIVISION_BY_ZERO_SI_CODE SI_TKILL
+# define DIVISION_BY_ZERO_TRIGGERS_FPE 0
+# define DIVISION_BY_ZERO_SI_CODE SI_TKILL
+#elif defined(__arm__)
+# define DIVISION_BY_ZERO_TRIGGERS_FPE 1
+# define DIVISION_BY_ZERO_SI_CODE SI_TKILL
#else
-#define DIVISION_BY_ZERO_TRIGGERS_FPE 1
-#define DIVISION_BY_ZERO_SI_CODE FPE_INTDIV
+# define DIVISION_BY_ZERO_TRIGGERS_FPE 1
+# define DIVISION_BY_ZERO_SI_CODE FPE_INTDIV
#endif