gcc/testsuite/gcc.dg/atomic-lockfree-aux.c
raw| 1 | /* Test supply a __atomic_is_lock_free routine for lock-free tests. */ |
| 2 | /* Just compile it on its own. */ |
| 3 | /* { dg-do compile } */ |
| 4 | /* { dg-options "-w" } */ |
| 5 | |
| 6 | /* Test that __atomic_{is,always}_lock_free builtins execute. */ |
| 7 | |
| 8 | #include <stdlib.h> |
| 9 | |
| 10 | /* Supply a builtin external function which returns a non-standard value so |
| 11 | it can be detected that it was called. */ |
| 12 | int |
| 13 | __atomic_is_lock_free (size_t s, void *p) |
| 14 | { |
| 15 | return 2; |
| 16 | } |
| 17 |