From dda87279c17374baa2b7e1c7e60840c336e09d66 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 26 Apr 2019 14:17:49 +0200 Subject: update conaddr test to catch early segfaults --- test/conaddr.ssa | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/conaddr.ssa b/test/conaddr.ssa index 3f0aba7..43177ba 100644 --- a/test/conaddr.ssa +++ b/test/conaddr.ssa @@ -45,21 +45,21 @@ function $writeto0() { # #include # #include # char a[] = "qbe rocks"; -# int ok = 1; +# int ok; # extern unsigned f0(long), f1(long), f2(long, long); # extern char *f3(long); # extern void writeto0(); # void h(int sig, siginfo_t *si, void *unused) { -# ok &= si->si_addr == 0; -# exit(!ok); +# ok += si->si_addr == 0; +# exit(!(ok == 5)); # } # int main() { # struct sigaction sa = {.sa_flags=SA_SIGINFO, .sa_sigaction=h}; # sigemptyset(&sa.sa_mask); sigaction(SIGSEGV, &sa, 0); -# ok &= f0(2) == 'e'; -# ok &= f1((long)a-5) == 'o'; -# ok &= f2(4, 2) == 's'; -# ok &= *f3(0) == 'q'; +# ok += f0(2) == 'e'; +# ok += f1((long)a-5) == 'o'; +# ok += f2(4, 2) == 's'; +# ok += *f3(0) == 'q'; # writeto0(); /* will segfault */ # } # <<< -- cgit 1.4.1