1 # test amd64 addressing modes
12 function w $f1(l %o) {
21 function w $f2(l %o1, l %o2) {
31 function l $f3(l %o) {
45 function $writeto0() {
54 # char a[] = "qbe rocks";
57 # extern unsigned f0(long), f1(long), f2(long, long);
58 # extern char *f3(long);
59 # extern void f4(), writeto0();
60 # void h(int sig, siginfo_t *si, void *unused) {
61 # ok += si->si_addr == 0;
65 # struct sigaction sa = {.sa_flags=SA_SIGINFO, .sa_sigaction=h};
66 # sigemptyset(&sa.sa_mask); sigaction(SIGSEGV, &sa, 0);
68 # ok += f1((long)a-5) == 'o';
69 # ok += f2(4, 2) == 's';
70 # ok += *f3(0) == 'q';
73 # writeto0(); /* will segfault */