gcc/testsuite/gcc.dg/tree-ssa/pr118483-4.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 3 | /* PR tree-optimization/118483 */ |
| 4 | /* { dg-final { scan-tree-dump "return 0;" "optimized" } } */ |
| 5 | |
| 6 | /* This should optimize down to just `return 0;` */ |
| 7 | /* as `a == 0` and `a != 0` are opposites. */ |
| 8 | int f(int a) |
| 9 | { |
| 10 | return (a == 0) == (a != 0); |
| 11 | } |