1 /* Test generic __atomic routines for various errors. */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target sync_int_long } */
4 /* { dg-options "-ansi" } */
8 __atomic_compare_exchange(p, p, p, 0, 0, 0); /* { dg-error "must be a non-void pointer type" } */
14 __atomic_load (&a, &b, __ATOMIC_SEQ_CST); /* { dg-error "must be a pointer to a constant size" } */
21 __atomic_load (&a, &b, __ATOMIC_SEQ_CST); /* { dg-error "must be a pointer to a nonzero size" } */
24 void f4 (int a, int b, int c)
26 __atomic_load (&a, &b, &c, __ATOMIC_SEQ_CST); /* { dg-error "incorrect number of arguments" } */
29 void f5 (int a, int b)
31 __atomic_load (&a, b, __ATOMIC_SEQ_CST); /* { dg-error "must be a pointer type" } */
34 void f6 (int a, char b)
36 __atomic_load (&a, &b, __ATOMIC_SEQ_CST); /* { dg-error "size mismatch in argument" } */
39 void f7 (int a, int b)
41 __atomic_load (&a, &b, 45); /* { dg-warning "invalid memory model argument" } */
44 void f8 (int a, int b, float c)
46 __atomic_load (&a, &b, c); /* { dg-error "non-integer memory model argument" } */