]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/attr-access-3.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / attr-access-3.c
CommitLineData
df90f070
MS
1/* PR middle-end/97879 - ICE on invalid mode in attribute access
2 { dg-do compile }
3 { dg-options "-Wall" } */
4
5#define A(...) __attribute__ ((access (__VA_ARGS__)))
6
7A (" ", 1) void f1 (int *); // { dg-error "attribute 'access' mode '\" \"' is not an identifier; expected one of 'read_only', 'read_write', 'write_only', or 'none'" }
8 void f1 (int *);
9
10
11A ("none", 1) void f2 (char *); // { dg-error "not an identifier" }
12 void f2 (char *);
13
14A (1) void f3 (); // { dg-error "not an identifier" }
15
16A (1, 2) void f4 (); // { dg-error "not an identifier" }
17A (2., 3.) void f5 (); // { dg-error "not an identifier" }
18
19// Verify that copying a valid access attribute doesn't cause errors.
20A (read_only, 1, 2) void f6 (void*, int);
21__attribute__ ((copy (f6))) void f7 (void*, int);