migration/multifd: correct multifd_send_thread to trace the flags
[qemu/armbru.git] / tests / tcg / aarch64 / pcalign-a64.c
blob6b9277f919f4c01f8492f729c73601c94e3fe45b
1 /* Test PC misalignment exception */
3 #include <assert.h>
4 #include <signal.h>
5 #include <stdlib.h>
6 #include <stdio.h>
8 static void *expected;
10 static void sigbus(int sig, siginfo_t *info, void *vuc)
12 assert(info->si_code == BUS_ADRALN);
13 assert(info->si_addr == expected);
14 exit(EXIT_SUCCESS);
17 int main()
19 void *tmp;
21 struct sigaction sa = {
22 .sa_sigaction = sigbus,
23 .sa_flags = SA_SIGINFO
26 if (sigaction(SIGBUS, &sa, NULL) < 0) {
27 perror("sigaction");
28 return EXIT_FAILURE;
31 asm volatile("adr %0, 1f + 1\n\t"
32 "str %0, %1\n\t"
33 "br %0\n"
34 "1:"
35 : "=&r"(tmp), "=m"(expected));
36 abort();