summaryrefslogtreecommitdiffstats
path: root/source/l/gc/gc.test-stack-infinite-loop.diff
blob: 49a6046e88dcd7bb09b93bd461a79274c4e4d012 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
diff --git a/libatomic_ops/tests/test_atomic.c b/libatomic_ops/tests/test_atomic.c
index e354024..b8906e9 100644
--- a/libatomic_ops/tests/test_atomic.c
+++ b/libatomic_ops/tests/test_atomic.c
@@ -77,7 +77,10 @@ void * acqrel_thr(void *id)
       {
         AO_t my_counter1;
     if (me != 1)
-      fprintf(stderr, "acqrel test: too many threads\n");
+      {
+        fprintf(stderr, "acqrel test: too many threads\n");
+        abort();
+      }
     my_counter1 = AO_load(&counter1);
     AO_store(&counter1, my_counter1 + 1);
     AO_store_release_write(&counter2, my_counter1 + 1);
diff --git a/libatomic_ops/tests/test_malloc.c b/libatomic_ops/tests/test_malloc.c
index a1f4179..a19ffd5 100644
--- a/libatomic_ops/tests/test_malloc.c
+++ b/libatomic_ops/tests/test_malloc.c
@@ -151,6 +151,7 @@ void * run_one_test(void * arg) {
   if (0 == p) {
 #   ifdef HAVE_MMAP
       fprintf(stderr, "AO_malloc(%d) failed\n", LARGE_OBJ_SIZE);
+      abort();
 #   else
       fprintf(stderr, "AO_malloc(%d) failed: This is normal without mmap\n",
               LARGE_OBJ_SIZE);
diff --git a/libatomic_ops/tests/test_stack.c b/libatomic_ops/tests/test_stack.c
index bf3180d..e654c35 100644
--- a/libatomic_ops/tests/test_stack.c
+++ b/libatomic_ops/tests/test_stack.c
@@ -97,14 +97,23 @@ void check_list(int n)
        p = (list_element *)AO_REAL_NEXT_PTR(p -> next))
     {
       if (p -> data > n || p -> data <= 0)
-        fprintf(stderr, "Found erroneous list element %d\n", p -> data);
+        {
+          fprintf(stderr, "Found erroneous list element %d\n", i);
+          abort();
+        }
       if (marks[p -> data] != 0)
-        fprintf(stderr, "Found duplicate list element %d\n", p -> data);
+        {
+          fprintf(stderr, "Found duplicate list element %d\n", i);
+          abort();
+        }
       marks[p -> data] = 1;
     }
   for (i = 1; i <= n; ++i)
     if (marks[i] != 1)
-      fprintf(stderr, "Missing list element %d\n", i);
+      {
+        fprintf(stderr, "Missing list element %d\n", i);
+        abort();
+      }
 }
 
 volatile AO_t ops_performed = 0;
@@ -218,6 +227,7 @@ int main(int argc, char **argv)
           int code;
           if ((code = pthread_join(thread[i], 0)) != 0) {
             fprintf(stderr, "Thread join failed %u\n", code);
+            abort();
           }
         }
         times[nthreads][exper_n] = (unsigned long)(get_msecs() - start_time);