1 /* PR middle-end/81824 - Warn for missing attributes with function aliases
2 Exercise error handling for attribute copy.
4 { dg-require-alias "" }
5 { dg-options "-O2 -Wall" } */
7 #define ATTR(list) __attribute__ (list)
9 /* Verify incorrect numbers of arguments. */
11 fno_args (void); /* { dg-error "wrong number of arguments specified for .copy. attribute" } */
14 fno_args2 (void); /* { dg-error "wrong number of arguments specified for .copy. attribute" } */
16 ATTR ((copy (fno_args
, fno_args
))) void
17 fmlti_args (void); /* { dg-error "wrong number of arguments specified for .copy. attribute" } */
19 /* Verify that referencing an undeclared symbol is rejected with an error. */
21 ATTR ((copy (foobar
))) /* { dg-error ".foobar. undeclared" } */
22 void fundeclared (void);
24 /* Verify that using a string argument triggers a descriptive error
25 (given attributes like alias and weakref using a string is a likely
28 ATTR ((copy ("foobar")))
29 void fstring (void); /* { dg-error ".copy. attribute argument cannot be a string" } */
31 /* Ditto for an integer. */
34 void fnumber (void); /* { dg-error ".copy. attribute argument cannot be a constant arithmetic expression" } */