arm: fix typo in dg-require-effective-target [PR118089]
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / cast-3.c
blob37214ecb9158bf242a22fc5e2d26e5f3be52cd50
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 /* PR tree-optimization/117776 */
6 /* These 2 functions should be optimized to just `return 1;`
7 as `(int)(unsigned smaller)medium` is the same as
8 `(int)medium&smaller_mask` where smaller_mask in this case is
9 either `1` (_Bool) or `0xff` (char). */
10 int f(unsigned char a)
12 _Bool odd = (a & 1) != 0;
13 int odd1 = (a & 1) != 0;
14 return odd == odd1;
16 int g(unsigned short a)
18 unsigned char b = a;
19 int d = b;
20 unsigned short c = a&0xff;
21 int e = c;
22 return d == e;
25 /* { dg-final { scan-tree-dump-times "return 1" 2 "optimized" } } */