1 /* PR middle-end/81824 - Warn for missing attributes with function aliases
2 Exercise error handling for attribute copy.
4 { dg-options "-O2 -Wall" } */
6 #define ATTR(list) __attribute__ (list)
8 /* Verify incorrect numbers of arguments. */
10 fno_args (void); /* { dg-error "wrong number of arguments specified for .copy. attribute" } */
13 fno_args2 (void); /* { dg-error "wrong number of arguments specified for .copy. attribute" } */
15 ATTR ((copy (fno_args
, fno_args
))) void
16 fmlti_args (void); /* { dg-error "wrong number of arguments specified for .copy. attribute" } */
18 /* Verify that referencing an undeclared symbol is rejected with an error. */
20 ATTR ((copy (foobar
))) /* { dg-error ".foobar. undeclared" } */
21 void fundeclared (void);
23 /* Verify that using a string argument triggers a descriptive error
24 (given attributes like alias and weakref using a string is a likely
27 ATTR ((copy ("foobar")))
28 void fstring (void); /* { dg-error ".copy. attribute argument cannot be a string" } */
30 /* Ditto for an integer. */
33 void fnumber (void); /* { dg-error ".copy. attribute argument cannot be a constant arithmetic expression" } */