]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/attr-access.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / attr-access.c
1 /* PR c/93640 - The write_only and read_write attributes can be mistyped
2 due to invalid strncmp size argument
3 { dg-do compile }
4 { dg-options "-Wall" } */
5
6 __attribute__ ((access (read_onl))) int f0 (char*); // { dg-error "attribute 'access' invalid mode 'read_onl'" }
7 __attribute__ ((access (write_onl))) int f1 (char*); // { dg-error "attribute 'access' invalid mode 'write_onl'" }
8 __attribute__ ((access (read_writ))) int f2 (char*); // { dg-error "attribute 'access' invalid mode 'read_writ'" }
9
10 __attribute__ ((access (read_onlX))) int f3 (char*); // { dg-error "attribute 'access' invalid mode 'read_onlX'" }
11 __attribute__ ((access (write_onlX))) int f4 (char*); // { dg-error "attribute 'access' invalid mode 'write_onlX'" }
12 __attribute__ ((access (read_writX))) int f5 (char*); // { dg-error "attribute 'access' invalid mode 'read_writX'" }
13
14
15 __attribute__ ((access (read_onl, 1))) int f7 (char*); // { dg-error "attribute 'access' invalid mode 'read_onl'" }
16 __attribute__ ((access (write_onl, 1))) int f8 (char*); // { dg-error "attribute 'access' invalid mode 'write_onl'" }
17 __attribute__ ((access (read_writ, 1))) int f9 (char*); // { dg-error "attribute 'access' invalid mode 'read_writ'" }
18
19 __attribute__ ((access (read_onlX, 1))) int f10 (char*); // { dg-error "attribute 'access' invalid mode 'read_onlX'" }
20 __attribute__ ((access (write_onlX, 1))) int f11 (char*); // { dg-error "attribute 'access' invalid mode 'write_onlX'" }
21 __attribute__ ((access (read_writX, 1))) int f12 (char*); // { dg-error "attribute 'access' invalid mode 'read_writX'" }