Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gcc.dg / fold-bitand-4.c
blob7d824260ff0749d69bb6d80026da43515cbfda48
1 /* { dg-do compile } */
2 /* { dg-options "-fdump-tree-original" } */
4 typedef char char4[4] __attribute__ ((aligned (4)));
5 char4 c4[4] __attribute__ ((aligned (16)));
7 typedef char char16[16] __attribute__ ((aligned (16)));
8 char16 c16[4] __attribute__ ((aligned (4)));
10 int f1 (void)
12 /* 12 */
13 return 15 & (__SIZE_TYPE__)&c4[3];
16 int f2 (int i)
18 /* Indeterminate */
19 return 15 & (__SIZE_TYPE__)&c4[i];
22 int f3 (int i)
24 /* 0 */
25 return 3 & (__SIZE_TYPE__)&c4[i];
28 int f4 (int i)
30 /* Indeterminate */
31 return 7 & (__SIZE_TYPE__)&c16[i];
34 int f5 (int i)
36 /* 0 */
37 return 3 & (__SIZE_TYPE__)&c16[i];
40 /* { dg-final { scan-tree-dump-times "return 12" 1 "original" } } */
41 /* { dg-final { scan-tree-dump-times "\& 15" 1 "original" } } */
42 /* { dg-final { scan-tree-dump-times "return 0" 2 "original" } } */
43 /* { dg-final { scan-tree-dump-times "\& 7" 1 "original" } } */
44 /* { dg-final { cleanup-tree-dump "original" } } */