]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/attr-assume_aligned-4.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / attr-assume_aligned-4.c
CommitLineData
1d249509
MS
1/* PR middle-end/87533 - bogus assume_aligned attribute silently accepted
2 { dg-do compile }
3 { dg-options "-Wall" } */
4
5#define A(...) __attribute__ ((assume_aligned (__VA_ARGS__)))
6
7A (1) void fv_1 (void); /* { dg-warning ".assume_aligned. attribute ignored on a function returning .void." } */
8
9A (1) int fi_1 (void); /* { dg-warning ".assume_aligned. attribute ignored on a function returning .int." } */
10
30a4d95b 11A (-1) void* fpv_m1 (void); /* { dg-warning ".assume_aligned. attribute argument -1 is not positive" } */
1d249509
MS
12
13A (0) void* fpv_0 (void); /* { dg-warning ".assume_aligned. attribute argument 0 is not a power of 2" } */
14
15/* Alignment of 1 is fine, it just doesn't offer any benefits. */
16A (1) void* fpv_1 (void);
17
18A (3) void* fpv_3 (void); /* { dg-warning ".assume_aligned. attribute argument 3 is not a power of 2" } */
19
20A (16383) void* fpv_16km1 (void); /* { dg-warning ".assume_aligned. attribute argument 16383 is not a power of 2" } */
21A (16384) void* fpv_16k (void);
22A (16385) void* fpv_16kp1 (void); /* { dg-warning ".assume_aligned. attribute argument 16385 is not a power of 2" } */
23
24A (32767) void* fpv_32km1 (void); /* { dg-warning ".assume_aligned. attribute argument 32767 is not a power of 2" } */
25
30a4d95b 26A (4, -1) void* fpv_4_m1 (void); /* { dg-warning ".assume_aligned. attribute argument -1 is not positive" } */
1d249509
MS
27
28A (4, 0) void* fpv_4_0 (void);
29A (4, 1) void* fpv_4_1 (void);
30A (4, 2) void* fpv_4_2 (void);
31A (4, 3) void* fpv_4_3 (void);
32
a9c697b8 33A (4, 4) void* fpv_4_3 (void); /* { dg-warning ".assume_aligned. attribute argument 4 is not in the range \\\[0, 3]" } */
1d249509
MS
34
35A (4) void* gpv_4_3 (void);
36A (2) void* gpv_4_3 (void);