implemented Setup.hs to build boehm cpp libs and install them;
[hs-boehmgc.git] / gc-7.2 / libatomic_ops / tests / list_atomic.c
1 #include "atomic_ops.h" 
2 /*
3  * Copyright (c) 2003 by Hewlett-Packard Company.  All rights reserved.
4  *
5  * This file is covered by the GNU general public license, version 2.
6  * see doc/COPYING for details.
7  */
8
9 /* This generates a compilable program.  But it is really meant to be   */
10 /* be used only with cc -E, to inspect the expensions generated by      */
11 /* primitives.                                                          */
12
13 /* The result will not link or run.                                     */
14
15 void list_atomic(void)
16 {
17   AO_T val, newval = 0, oldval = 0;
18   AO_TS_T ts;
19   long incr = 0;
20
21 # if defined(AO_HAVE_nop)
22     "AO_nop(): ";
23     AO_nop();
24 # else
25     "No AO_nop";
26 # endif
27 # if defined(AO_HAVE_load)
28     "AO_load(&val):";
29     AO_load(&val);
30 # else
31     "No AO_load";
32 # endif
33 # if defined(AO_HAVE_store)
34     "AO_store(&val, newval):";
35     AO_store(&val, newval);
36 # else
37     "No AO_store";
38 # endif
39 # if defined(AO_HAVE_test_and_set)
40     "AO_test_and_set(&ts):";
41     AO_test_and_set(&ts);
42 # else
43     "No AO_test_and_set";
44 # endif
45 # if defined(AO_HAVE_fetch_and_add1)
46     "AO_fetch_and_add1(&val):";
47     AO_fetch_and_add1(&val);
48 # else
49     "No AO_fetch_and_add1";
50 # endif
51 # if defined(AO_HAVE_fetch_and_sub1)
52     "AO_fetch_and_sub1(&val):";
53     AO_fetch_and_sub1(&val);
54 # else
55     "No AO_fetch_and_sub1";
56 # endif
57 # if defined(AO_HAVE_fetch_and_add)
58     "AO_fetch_and_add(&val, incr):";
59     AO_fetch_and_add(&val, incr);
60 # else
61     "No AO_fetch_and_add";
62 # endif
63 # if defined(AO_HAVE_compare_and_swap)
64     "AO_compare_and_swap(&val, oldval, newval):";
65     AO_compare_and_swap(&val, oldval, newval);
66 # else
67     "No AO_compare_and_swap";
68 # endif
69 }
70 /*
71  * Copyright (c) 2003 by Hewlett-Packard Company.  All rights reserved.
72  *
73  * This file is covered by the GNU general public license, version 2.
74  * see doc/COPYING for details.
75  */
76
77 /* This generates a compilable program.  But it is really meant to be   */
78 /* be used only with cc -E, to inspect the expensions generated by      */
79 /* primitives.                                                          */
80
81 /* The result will not link or run.                                     */
82
83 void list_atomic_release(void)
84 {
85   AO_T val, newval = 0, oldval = 0;
86   AO_TS_T ts;
87   long incr = 0;
88
89 # if defined(AO_HAVE_nop_release)
90     "AO_nop_release(): ";
91     AO_nop_release();
92 # else
93     "No AO_nop_release";
94 # endif
95 # if defined(AO_HAVE_load_release)
96     "AO_load_release(&val):";
97     AO_load_release(&val);
98 # else
99     "No AO_load_release";
100 # endif
101 # if defined(AO_HAVE_store_release)
102     "AO_store_release(&val, newval):";
103     AO_store_release(&val, newval);
104 # else
105     "No AO_store_release";
106 # endif
107 # if defined(AO_HAVE_test_and_set_release)
108     "AO_test_and_set_release(&ts):";
109     AO_test_and_set_release(&ts);
110 # else
111     "No AO_test_and_set_release";
112 # endif
113 # if defined(AO_HAVE_fetch_and_add1_release)
114     "AO_fetch_and_add1_release(&val):";
115     AO_fetch_and_add1_release(&val);
116 # else
117     "No AO_fetch_and_add1_release";
118 # endif
119 # if defined(AO_HAVE_fetch_and_sub1_release)
120     "AO_fetch_and_sub1_release(&val):";
121     AO_fetch_and_sub1_release(&val);
122 # else
123     "No AO_fetch_and_sub1_release";
124 # endif
125 # if defined(AO_HAVE_fetch_and_add_release)
126     "AO_fetch_and_add_release(&val, incr):";
127     AO_fetch_and_add_release(&val, incr);
128 # else
129     "No AO_fetch_and_add_release";
130 # endif
131 # if defined(AO_HAVE_compare_and_swap_release)
132     "AO_compare_and_swap_release(&val, oldval, newval):";
133     AO_compare_and_swap_release(&val, oldval, newval);
134 # else
135     "No AO_compare_and_swap_release";
136 # endif
137 }
138 /*
139  * Copyright (c) 2003 by Hewlett-Packard Company.  All rights reserved.
140  *
141  * This file is covered by the GNU general public license, version 2.
142  * see doc/COPYING for details.
143  */
144
145 /* This generates a compilable program.  But it is really meant to be   */
146 /* be used only with cc -E, to inspect the expensions generated by      */
147 /* primitives.                                                          */
148
149 /* The result will not link or run.                                     */
150
151 void list_atomic_acquire(void)
152 {
153   AO_T val, newval = 0, oldval = 0;
154   AO_TS_T ts;
155   long incr = 0;
156
157 # if defined(AO_HAVE_nop_acquire)
158     "AO_nop_acquire(): ";
159     AO_nop_acquire();
160 # else
161     "No AO_nop_acquire";
162 # endif
163 # if defined(AO_HAVE_load_acquire)
164     "AO_load_acquire(&val):";
165     AO_load_acquire(&val);
166 # else
167     "No AO_load_acquire";
168 # endif
169 # if defined(AO_HAVE_store_acquire)
170     "AO_store_acquire(&val, newval):";
171     AO_store_acquire(&val, newval);
172 # else
173     "No AO_store_acquire";
174 # endif
175 # if defined(AO_HAVE_test_and_set_acquire)
176     "AO_test_and_set_acquire(&ts):";
177     AO_test_and_set_acquire(&ts);
178 # else
179     "No AO_test_and_set_acquire";
180 # endif
181 # if defined(AO_HAVE_fetch_and_add1_acquire)
182     "AO_fetch_and_add1_acquire(&val):";
183     AO_fetch_and_add1_acquire(&val);
184 # else
185     "No AO_fetch_and_add1_acquire";
186 # endif
187 # if defined(AO_HAVE_fetch_and_sub1_acquire)
188     "AO_fetch_and_sub1_acquire(&val):";
189     AO_fetch_and_sub1_acquire(&val);
190 # else
191     "No AO_fetch_and_sub1_acquire";
192 # endif
193 # if defined(AO_HAVE_fetch_and_add_acquire)
194     "AO_fetch_and_add_acquire(&val, incr):";
195     AO_fetch_and_add_acquire(&val, incr);
196 # else
197     "No AO_fetch_and_add_acquire";
198 # endif
199 # if defined(AO_HAVE_compare_and_swap_acquire)
200     "AO_compare_and_swap_acquire(&val, oldval, newval):";
201     AO_compare_and_swap_acquire(&val, oldval, newval);
202 # else
203     "No AO_compare_and_swap_acquire";
204 # endif
205 }
206 /*
207  * Copyright (c) 2003 by Hewlett-Packard Company.  All rights reserved.
208  *
209  * This file is covered by the GNU general public license, version 2.
210  * see doc/COPYING for details.
211  */
212
213 /* This generates a compilable program.  But it is really meant to be   */
214 /* be used only with cc -E, to inspect the expensions generated by      */
215 /* primitives.                                                          */
216
217 /* The result will not link or run.                                     */
218
219 void list_atomic_read(void)
220 {
221   AO_T val, newval = 0, oldval = 0;
222   AO_TS_T ts;
223   long incr = 0;
224
225 # if defined(AO_HAVE_nop_read)
226     "AO_nop_read(): ";
227     AO_nop_read();
228 # else
229     "No AO_nop_read";
230 # endif
231 # if defined(AO_HAVE_load_read)
232     "AO_load_read(&val):";
233     AO_load_read(&val);
234 # else
235     "No AO_load_read";
236 # endif
237 # if defined(AO_HAVE_store_read)
238     "AO_store_read(&val, newval):";
239     AO_store_read(&val, newval);
240 # else
241     "No AO_store_read";
242 # endif
243 # if defined(AO_HAVE_test_and_set_read)
244     "AO_test_and_set_read(&ts):";
245     AO_test_and_set_read(&ts);
246 # else
247     "No AO_test_and_set_read";
248 # endif
249 # if defined(AO_HAVE_fetch_and_add1_read)
250     "AO_fetch_and_add1_read(&val):";
251     AO_fetch_and_add1_read(&val);
252 # else
253     "No AO_fetch_and_add1_read";
254 # endif
255 # if defined(AO_HAVE_fetch_and_sub1_read)
256     "AO_fetch_and_sub1_read(&val):";
257     AO_fetch_and_sub1_read(&val);
258 # else
259     "No AO_fetch_and_sub1_read";
260 # endif
261 # if defined(AO_HAVE_fetch_and_add_read)
262     "AO_fetch_and_add_read(&val, incr):";
263     AO_fetch_and_add_read(&val, incr);
264 # else
265     "No AO_fetch_and_add_read";
266 # endif
267 # if defined(AO_HAVE_compare_and_swap_read)
268     "AO_compare_and_swap_read(&val, oldval, newval):";
269     AO_compare_and_swap_read(&val, oldval, newval);
270 # else
271     "No AO_compare_and_swap_read";
272 # endif
273 }
274 /*
275  * Copyright (c) 2003 by Hewlett-Packard Company.  All rights reserved.
276  *
277  * This file is covered by the GNU general public license, version 2.
278  * see doc/COPYING for details.
279  */
280
281 /* This generates a compilable program.  But it is really meant to be   */
282 /* be used only with cc -E, to inspect the expensions generated by      */
283 /* primitives.                                                          */
284
285 /* The result will not link or run.                                     */
286
287 void list_atomic_write(void)
288 {
289   AO_T val, newval = 0, oldval = 0;
290   AO_TS_T ts;
291   long incr = 0;
292
293 # if defined(AO_HAVE_nop_write)
294     "AO_nop_write(): ";
295     AO_nop_write();
296 # else
297     "No AO_nop_write";
298 # endif
299 # if defined(AO_HAVE_load_write)
300     "AO_load_write(&val):";
301     AO_load_write(&val);
302 # else
303     "No AO_load_write";
304 # endif
305 # if defined(AO_HAVE_store_write)
306     "AO_store_write(&val, newval):";
307     AO_store_write(&val, newval);
308 # else
309     "No AO_store_write";
310 # endif
311 # if defined(AO_HAVE_test_and_set_write)
312     "AO_test_and_set_write(&ts):";
313     AO_test_and_set_write(&ts);
314 # else
315     "No AO_test_and_set_write";
316 # endif
317 # if defined(AO_HAVE_fetch_and_add1_write)
318     "AO_fetch_and_add1_write(&val):";
319     AO_fetch_and_add1_write(&val);
320 # else
321     "No AO_fetch_and_add1_write";
322 # endif
323 # if defined(AO_HAVE_fetch_and_sub1_write)
324     "AO_fetch_and_sub1_write(&val):";
325     AO_fetch_and_sub1_write(&val);
326 # else
327     "No AO_fetch_and_sub1_write";
328 # endif
329 # if defined(AO_HAVE_fetch_and_add_write)
330     "AO_fetch_and_add_write(&val, incr):";
331     AO_fetch_and_add_write(&val, incr);
332 # else
333     "No AO_fetch_and_add_write";
334 # endif
335 # if defined(AO_HAVE_compare_and_swap_write)
336     "AO_compare_and_swap_write(&val, oldval, newval):";
337     AO_compare_and_swap_write(&val, oldval, newval);
338 # else
339     "No AO_compare_and_swap_write";
340 # endif
341 }
342 /*
343  * Copyright (c) 2003 by Hewlett-Packard Company.  All rights reserved.
344  *
345  * This file is covered by the GNU general public license, version 2.
346  * see doc/COPYING for details.
347  */
348
349 /* This generates a compilable program.  But it is really meant to be   */
350 /* be used only with cc -E, to inspect the expensions generated by      */
351 /* primitives.                                                          */
352
353 /* The result will not link or run.                                     */
354
355 void list_atomic_full(void)
356 {
357   AO_T val, newval = 0, oldval = 0;
358   AO_TS_T ts;
359   long incr = 0;
360
361 # if defined(AO_HAVE_nop_full)
362     "AO_nop_full(): ";
363     AO_nop_full();
364 # else
365     "No AO_nop_full";
366 # endif
367 # if defined(AO_HAVE_load_full)
368     "AO_load_full(&val):";
369     AO_load_full(&val);
370 # else
371     "No AO_load_full";
372 # endif
373 # if defined(AO_HAVE_store_full)
374     "AO_store_full(&val, newval):";
375     AO_store_full(&val, newval);
376 # else
377     "No AO_store_full";
378 # endif
379 # if defined(AO_HAVE_test_and_set_full)
380     "AO_test_and_set_full(&ts):";
381     AO_test_and_set_full(&ts);
382 # else
383     "No AO_test_and_set_full";
384 # endif
385 # if defined(AO_HAVE_fetch_and_add1_full)
386     "AO_fetch_and_add1_full(&val):";
387     AO_fetch_and_add1_full(&val);
388 # else
389     "No AO_fetch_and_add1_full";
390 # endif
391 # if defined(AO_HAVE_fetch_and_sub1_full)
392     "AO_fetch_and_sub1_full(&val):";
393     AO_fetch_and_sub1_full(&val);
394 # else
395     "No AO_fetch_and_sub1_full";
396 # endif
397 # if defined(AO_HAVE_fetch_and_add_full)
398     "AO_fetch_and_add_full(&val, incr):";
399     AO_fetch_and_add_full(&val, incr);
400 # else
401     "No AO_fetch_and_add_full";
402 # endif
403 # if defined(AO_HAVE_compare_and_swap_full)
404     "AO_compare_and_swap_full(&val, oldval, newval):";
405     AO_compare_and_swap_full(&val, oldval, newval);
406 # else
407     "No AO_compare_and_swap_full";
408 # endif
409 }
410 /*
411  * Copyright (c) 2003 by Hewlett-Packard Company.  All rights reserved.
412  *
413  * This file is covered by the GNU general public license, version 2.
414  * see doc/COPYING for details.
415  */
416
417 /* This generates a compilable program.  But it is really meant to be   */
418 /* be used only with cc -E, to inspect the expensions generated by      */
419 /* primitives.                                                          */
420
421 /* The result will not link or run.                                     */
422
423 void list_atomic_release_write(void)
424 {
425   AO_T val, newval = 0, oldval = 0;
426   AO_TS_T ts;
427   long incr = 0;
428
429 # if defined(AO_HAVE_nop_release_write)
430     "AO_nop_release_write(): ";
431     AO_nop_release_write();
432 # else
433     "No AO_nop_release_write";
434 # endif
435 # if defined(AO_HAVE_load_release_write)
436     "AO_load_release_write(&val):";
437     AO_load_release_write(&val);
438 # else
439     "No AO_load_release_write";
440 # endif
441 # if defined(AO_HAVE_store_release_write)
442     "AO_store_release_write(&val, newval):";
443     AO_store_release_write(&val, newval);
444 # else
445     "No AO_store_release_write";
446 # endif
447 # if defined(AO_HAVE_test_and_set_release_write)
448     "AO_test_and_set_release_write(&ts):";
449     AO_test_and_set_release_write(&ts);
450 # else
451     "No AO_test_and_set_release_write";
452 # endif
453 # if defined(AO_HAVE_fetch_and_add1_release_write)
454     "AO_fetch_and_add1_release_write(&val):";
455     AO_fetch_and_add1_release_write(&val);
456 # else
457     "No AO_fetch_and_add1_release_write";
458 # endif
459 # if defined(AO_HAVE_fetch_and_sub1_release_write)
460     "AO_fetch_and_sub1_release_write(&val):";
461     AO_fetch_and_sub1_release_write(&val);
462 # else
463     "No AO_fetch_and_sub1_release_write";
464 # endif
465 # if defined(AO_HAVE_fetch_and_add_release_write)
466     "AO_fetch_and_add_release_write(&val, incr):";
467     AO_fetch_and_add_release_write(&val, incr);
468 # else
469     "No AO_fetch_and_add_release_write";
470 # endif
471 # if defined(AO_HAVE_compare_and_swap_release_write)
472     "AO_compare_and_swap_release_write(&val, oldval, newval):";
473     AO_compare_and_swap_release_write(&val, oldval, newval);
474 # else
475     "No AO_compare_and_swap_release_write";
476 # endif
477 }
478 /*
479  * Copyright (c) 2003 by Hewlett-Packard Company.  All rights reserved.
480  *
481  * This file is covered by the GNU general public license, version 2.
482  * see doc/COPYING for details.
483  */
484
485 /* This generates a compilable program.  But it is really meant to be   */
486 /* be used only with cc -E, to inspect the expensions generated by      */
487 /* primitives.                                                          */
488
489 /* The result will not link or run.                                     */
490
491 void list_atomic_acquire_read(void)
492 {
493   AO_T val, newval = 0, oldval = 0;
494   AO_TS_T ts;
495   long incr = 0;
496
497 # if defined(AO_HAVE_nop_acquire_read)
498     "AO_nop_acquire_read(): ";
499     AO_nop_acquire_read();
500 # else
501     "No AO_nop_acquire_read";
502 # endif
503 # if defined(AO_HAVE_load_acquire_read)
504     "AO_load_acquire_read(&val):";
505     AO_load_acquire_read(&val);
506 # else
507     "No AO_load_acquire_read";
508 # endif
509 # if defined(AO_HAVE_store_acquire_read)
510     "AO_store_acquire_read(&val, newval):";
511     AO_store_acquire_read(&val, newval);
512 # else
513     "No AO_store_acquire_read";
514 # endif
515 # if defined(AO_HAVE_test_and_set_acquire_read)
516     "AO_test_and_set_acquire_read(&ts):";
517     AO_test_and_set_acquire_read(&ts);
518 # else
519     "No AO_test_and_set_acquire_read";
520 # endif
521 # if defined(AO_HAVE_fetch_and_add1_acquire_read)
522     "AO_fetch_and_add1_acquire_read(&val):";
523     AO_fetch_and_add1_acquire_read(&val);
524 # else
525     "No AO_fetch_and_add1_acquire_read";
526 # endif
527 # if defined(AO_HAVE_fetch_and_sub1_acquire_read)
528     "AO_fetch_and_sub1_acquire_read(&val):";
529     AO_fetch_and_sub1_acquire_read(&val);
530 # else
531     "No AO_fetch_and_sub1_acquire_read";
532 # endif
533 # if defined(AO_HAVE_fetch_and_add_acquire_read)
534     "AO_fetch_and_add_acquire_read(&val, incr):";
535     AO_fetch_and_add_acquire_read(&val, incr);
536 # else
537     "No AO_fetch_and_add_acquire_read";
538 # endif
539 # if defined(AO_HAVE_compare_and_swap_acquire_read)
540     "AO_compare_and_swap_acquire_read(&val, oldval, newval):";
541     AO_compare_and_swap_acquire_read(&val, oldval, newval);
542 # else
543     "No AO_compare_and_swap_acquire_read";
544 # endif
545 }