]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/attr-access-none.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / attr-access-none.c
CommitLineData
b825a228
MS
1/* Test to verify the handling of attribute access (none).
2 { dg-do compile }
3 { dg-options "-O -Wall -ftrack-macro-expansion=0" } */
4
5int __attribute__ ((access (none, 1)))
6fnone_pv1 (void*);
7
8void nowarn_fnone_pv1 (void)
9{
10 int x;
11 fnone_pv1 (&x);
12}
13
14
15int __attribute__ ((access (none, 1)))
16fnone_pcv1 (const void*);
17
18void nowarn_fnone_pcv1 (void)
19{
20 char a[2];
21 fnone_pcv1 (a);
22}
23
24
25int __attribute__ ((access (none, 1, 2)))
baad4c48 26fnone_pcv1_2 (const void*, int); // { dg-message "in a call to function 'fnone_pcv1_2' declared with attribute 'access \\\(none, 1, 2\\\)'" "note" }
b825a228
MS
27
28void nowarn_fnone_pcv1_2 (void)
29{
30 char a[2];
31 fnone_pcv1_2 (a, 2);
32}
33
34void 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}