comparison gcc/testsuite/c-c++-common/fold-bitand-4.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do compile { target { c } } } */
2 /* { dg-options "-fdump-tree-original" } */
3 /* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
4
5 typedef char char4[4] __attribute__ ((aligned (4)));
6 char4 c4[4] __attribute__ ((aligned (16)));
7
8 typedef char char16[16] __attribute__ ((aligned (16)));
9 char16 c16[4] __attribute__ ((aligned (4)));
10
11 int f1 (void)
12 {
13 /* 12 */
14 return 15 & (__SIZE_TYPE__)&c4[3];
15 }
16
17 int f2 (int i)
18 {
19 /* Indeterminate */
20 return 15 & (__SIZE_TYPE__)&c4[i];
21 }
22
23 int f3 (int i)
24 {
25 /* 0 */
26 return 3 & (__SIZE_TYPE__)&c4[i];
27 }
28
29 int f4 (int i)
30 {
31 /* Indeterminate */
32 return 7 & (__SIZE_TYPE__)&c16[i];
33 }
34
35 int f5 (int i)
36 {
37 /* 0 */
38 return 3 & (__SIZE_TYPE__)&c16[i];
39 }
40
41 /* { dg-final { scan-tree-dump-times "return \[^\n0-9\]*12;" 1 "original" } } */
42 /* { dg-final { scan-tree-dump-times "\& 15" 1 "original" } } */
43 /* { dg-final { scan-tree-dump-times "return \[^\n0-9\]*0;" 2 "original" } } */
44 /* { dg-final { scan-tree-dump-times "\& 7" 1 "original" } } */