1 /* Test PC misalignment exception */
4 #error "This test must be compiled for ARM"
12 static void *expected
;
14 static void sigbus(int sig
, siginfo_t
*info
, void *vuc
)
16 assert(info
->si_code
== BUS_ADRALN
);
17 assert(info
->si_addr
== expected
);
25 struct sigaction sa
= {
26 .sa_sigaction
= sigbus
,
27 .sa_flags
= SA_SIGINFO
30 if (sigaction(SIGBUS
, &sa
, NULL
) < 0) {
35 asm volatile("adr %0, 1f + 2\n\t"
39 : "=&r"(tmp
), "=m"(expected
));
42 * From v8, it is CONSTRAINED UNPREDICTABLE whether BXWritePC aligns
43 * the address or not. If so, we can legitimately fall through.