]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/attr-alloc_align-5.c
1 /* PR c/78666 - conflicting attribute alloc_size accepted
3 { dg-options "-Wall" } */
5 #define A(pos) __attribute__ ((alloc_align (pos)))
7 A (1) char* f2_1 (int, int);
8 A (1) char* f2_1 (int, int); // { dg-message "previous declaration here" }
10 A (2) char* f2_1 (int, int); // { dg-warning "ignoring attribute 'alloc_align \\\(2\\\)' because it conflicts with previous 'alloc_align \\\(1\\\)'" }
13 A (2) char* f2_2 (int, int);
14 A (2) char* f2_2 (int, int); // { dg-message "previous declaration here" }
16 A (1) char* f2_2 (int, int); // { dg-warning "ignoring attribute 'alloc_align \\\(1\\\)' because it conflicts with previous 'alloc_align \\\(2\\\)'" }
19 A (1) char* f3_1 (int, int, int);
20 A (1) char* f3_1 (int, int, int); // { dg-message "previous declaration here" }
22 A (2) char* f3_1 (int, int, int); // { dg-warning "ignoring attribute 'alloc_align \\\(2\\\)' because it conflicts with previous 'alloc_align \\\(1\\\)'" }
23 A (3) char* f3_1 (int, int, int); // { dg-warning "ignoring attribute 'alloc_align \\\(3\\\)' because it conflicts with previous 'alloc_align \\\(1\\\)'" }