2008-03-21 Janne Blomqvist <jb@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / fold-bitand-2.c
blobde2e67449b1fe25ce22978659f4c71af738652cc
1 /* { dg-do compile } */
2 /* { dg-options "-fdump-tree-original" } */
4 struct {
5 char c1;
6 char c2;
7 char c3;
8 char c4;
9 } s __attribute__ ((aligned (4)));
11 unsigned f1 (void)
13 return 3 & (__SIZE_TYPE__)&s.c1;
16 unsigned f2 (void)
18 return 3 & (__SIZE_TYPE__)&s.c2;
21 unsigned f3 (void)
23 return 3 & (__SIZE_TYPE__)&s.c3;
26 unsigned f4 (void)
28 return 3 & (__SIZE_TYPE__)&s.c4;
31 unsigned f5 (void)
33 return 4 & (__SIZE_TYPE__)&s.c1;
36 /* { dg-final { scan-tree-dump-times "\& 3" 0 "original" } } */
37 /* { dg-final { scan-tree-dump-times "\& 4" 1 "original" } } */
38 /* { dg-final { scan-tree-dump-times "return 0" 1 "original" } } */
39 /* { dg-final { scan-tree-dump-times "return 1" 1 "original" } } */
40 /* { dg-final { scan-tree-dump-times "return 2" 1 "original" } } */
41 /* { dg-final { scan-tree-dump-times "return 3" 1 "original" } } */
42 /* { dg-final { cleanup-tree-dump "original" } } */