gcc/testsuite/gcc.dg/pr94920-2.c
raw| 1 | /* PR tree-optimization/94920 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 4 | |
| 5 | /* Form from PR. */ |
| 6 | __attribute__((noipa)) unsigned int foo(int x) { |
| 7 | return x <= 0 ? -x : 0; |
| 8 | } |
| 9 | |
| 10 | /* Changed order. */ |
| 11 | __attribute__((noipa)) unsigned int bar(int x) { |
| 12 | return 0 >= x ? -x : 0; |
| 13 | } |
| 14 | |
| 15 | /* { dg-final {scan-tree-dump-times " MAX_EXPR " 2 "optimized" } } */ |