1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
6 return x
!= 0 ? -x
: 0;
11 return x
!= 1 ? -x
: -1;
16 return x
!= -1 ? -x
: 1;
19 unsigned int test_u0(unsigned int x
)
21 return x
!= 0 ? -x
: 0;
24 unsigned int test_u1(unsigned int x
)
26 return x
!= 1 ? -x
: ~0u;
29 unsigned int test_um1(unsigned int x
)
31 return x
!= ~0u ? -x
: 1;
34 unsigned char test_uc0(unsigned char x
)
36 return x
!= 0 ? -x
: 0;
39 unsigned char test_uc1(unsigned char x
)
41 return x
!= 1 ? -x
: 255;
44 unsigned char test_uc127(unsigned char x
)
46 return x
!= 127 ? -x
: 129;
49 unsigned char test_uc128(unsigned char x
)
51 return x
!= 128 ? -x
: 128;
54 unsigned char test_uc255(unsigned char x
)
56 return x
!= 255 ? -x
: 1;
59 /* { dg-final { scan-tree-dump-not "goto" "optimized" } } */