1 /* PR c/81566 - invalid attribute aligned accepted on functions
3 { dg-options "-Wall -Wattributes -ftrack-macro-expansion=0" } */
5 #define ATTR(list) __attribute__ (list)
6 #define ALIGN(n) ATTR ((aligned (n)))
8 /* It's okay to increase the alignment of a function. */
10 void ALIGN (16) ALIGN (32)
13 void ALIGN (16) falign32_2 (void);
14 void ALIGN (32) falign32_2 (void);
16 void falign32_2 (void) { }
18 void ALIGN (32) falign32_2 (void);
20 /* It's not okay to decrease it. */
22 void ALIGN (32) ALIGN (16)
23 falign64_3 (void); /* { dg-warning "ignoring attribute .aligned \\(16\\). because it conflicts with attribute .aligned \\(32\\)." } */
28 void falign64_3 (void);
30 void falign64_3 (void) { }
34 falign64_4 (void); /* { dg-message "previous declaration here" } */
37 falign64_4 (void); /* { dg-warning "ignoring attribute .aligned \\(16\\). because it conflicts with attribute .aligned \\(32\\)." } */
40 falign64_4 (void); /* { dg-message "previous declaration here" } */
43 falign64_4 (void); /* { dg-warning "ignoring attribute .aligned \\(16\\). because it conflicts with attribute .aligned \\(32\\)." } */
49 falign64_4 (void); /* { dg-warning "ignoring attribute .aligned \\(32\\). because it conflicts with attribute .aligned \\(64\\)." } */
51 void falign64_4 (void);
56 void falign64_4 (void);
62 void ATTR ((aligned (16), aligned (32)))
65 void ATTR ((aligned (32), aligned (64)))
68 void ATTR ((aligned (16), aligned (32), aligned (64)))
69 falign64_5 (void); /* { dg-warning "ignoring attribute .aligned \\(16\\). because it conflicts with attribute .aligned \\(64\\)." } */
70 /* { dg-warning "ignoring attribute .aligned \\(32\\). because it conflicts with attribute .aligned \\(64\\)." "" { target *-*-* } .-1 } */
73 void ATTR ((aligned (16), aligned (32), aligned (16)))
74 falign64_6 (void); /* { dg-warning "ignoring attribute .aligned \\(16\\). because it conflicts with attribute .aligned \\(32\\)." } */