1 /* Test __atomic routines for existence and execution with each valid
3 /* { dg-options "-w" } */
5 /* { dg-additional-sources "atomic-lockfree-aux.c" } */
7 /* Test that __atomic_{is,always}_lock_free builtins execute.
8 sync-mem-lockfree-aux.c supplies and external entry point for
9 __atomic_is_lock_free which always returns a 2. We can detect the
10 external routine was called if 2 is returned since that is not a valid
19 /* Test for consistency on sizes 1, 2, 4, 8, 16 and 32. */
23 r1 = __atomic_always_lock_free (sizeof(char), 0);
24 r2 = __atomic_is_lock_free (sizeof(char), 0);
25 /* If always lock free, then is_lock_free must also be true. */
33 /* If it is not lock free, then the external routine must be called. */
38 r1 = __atomic_always_lock_free (2, 0);
39 r2 = __atomic_is_lock_free (2, 0);
40 /* If always lock free, then is_lock_free must also be true. */
48 /* If it is not lock free, then the external routine must be called. */
54 r1 = __atomic_always_lock_free (4, 0);
55 r2 = __atomic_is_lock_free (4, 0); /* Try passing in a variable. */
56 /* If always lock free, then is_lock_free must also be true. */
64 /* If it is not lock free, then the external routine must be called. */
70 r1 = __atomic_always_lock_free (8, 0);
71 r2 = __atomic_is_lock_free (8, 0);
72 /* If always lock free, then is_lock_free must also be true. */
80 /* If it is not lock free, then the external routine must be called. */
86 r1 = __atomic_always_lock_free (16, 0);
87 r2 = __atomic_is_lock_free (16, 0);
88 /* If always lock free, then is_lock_free must also be true. */
96 /* If it is not lock free, then the external routine must be called. */
102 r1 = __atomic_always_lock_free (32, 0);
103 r2 = __atomic_is_lock_free (32, 0);
104 /* If always lock free, then is_lock_free must also be true. */
112 /* If it is not lock free, then the external routine must be called. */