PR target/83368
[official-gcc.git] / gcc / testsuite / gcc.dg / fold-bitand-1.c
blob68a7c27a6bb570e95ad8fe301d603072a2a8c90f
1 /* { dg-do compile } */
2 /* { dg-options "-w -fdump-tree-original" } */
4 char c1 __attribute__ ((aligned (1)));
5 char c2 __attribute__ ((aligned (2)));
6 char c4 __attribute__ ((aligned (4)));
7 char c8 __attribute__ ((aligned (8)));
8 unsigned f1(void)
10 return 3 & (__SIZE_TYPE__)&c1;
13 unsigned f2(void)
15 return 3 & (__SIZE_TYPE__)&c2;
18 unsigned f3(void)
20 return 3 & (__SIZE_TYPE__)&c4;
23 unsigned f4(void)
25 return 3 & (__SIZE_TYPE__)&c8;
28 /* { dg-final { scan-tree-dump-times "\&c1 \& 3" 1 "original" } } */
29 /* { dg-final { scan-tree-dump-times "\&c2 \& 3" 1 "original" } } */
30 /* { dg-final { scan-tree-dump-times "\&c4 \& 3" 0 "original" } } */
31 /* { dg-final { scan-tree-dump-times "\&c8 \& 3" 0 "original" } } */
32 /* { dg-final { scan-tree-dump-times "return 0" 2 "original" } } */