gcc/testsuite/gcc.dg/pr71514.c
raw| 1 | /* PR c/71514 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "" } */ |
| 4 | |
| 5 | void |
| 6 | foo () |
| 7 | { |
| 8 | } |
| 9 | |
| 10 | int a, b; |
| 11 | |
| 12 | void |
| 13 | fn1 (void) |
| 14 | { |
| 15 | __atomic_exchange (&a, &foo, &b, __ATOMIC_RELAXED); /* { dg-error "must not be a pointer to a function" } */ |
| 16 | } |
| 17 | |
| 18 | void |
| 19 | fn2 (int n) |
| 20 | { |
| 21 | int arr[n]; |
| 22 | __atomic_exchange (&a, &arr, &b, __ATOMIC_RELAXED); /* { dg-error "must be a pointer to a constant size type" } */ |
| 23 | } |