| 1 |
/* Test to verify the handling of attribute access (none). |
| 2 |
{ dg-do compile } |
| 3 |
{ dg-options "-O -Wall -ftrack-macro-expansion=0" } */ |
| 4 |
|
| 5 |
int __attribute__ ((access (none, 1))) |
| 6 |
fnone_pv1 (void*); |
| 7 |
|
| 8 |
void nowarn_fnone_pv1 (void) |
| 9 |
{ |
| 10 |
int x; |
| 11 |
fnone_pv1 (&x); |
| 12 |
} |
| 13 |
|
| 14 |
|
| 15 |
int __attribute__ ((access (none, 1))) |
| 16 |
fnone_pcv1 (const void*); |
| 17 |
|
| 18 |
void nowarn_fnone_pcv1 (void) |
| 19 |
{ |
| 20 |
char a[2]; |
| 21 |
fnone_pcv1 (a); |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
int __attribute__ ((access (none, 1, 2))) |
| 26 |
fnone_pcv1_2 (const void*, int); // { dg-message "in a call to function 'fnone_pcv1_2' declared with attribute 'access \\\(none, 1, 2\\\)'" "note" } |
| 27 |
|
| 28 |
void nowarn_fnone_pcv1_2 (void) |
| 29 |
{ |
| 30 |
char a[2]; |
| 31 |
fnone_pcv1_2 (a, 2); |
| 32 |
} |
| 33 |
|
| 34 |
void warn_fnone_pcv1_2 (void) |
| 35 |
{ |
| 36 |
char a[3]; |
| 37 |
fnone_pcv1_2 (a, 4); // { dg-warning "expecting 4 bytes in a region of size 3" } |
| 38 |
} |