gcc/testsuite/gcc.dg/fold-convmaxconv-1.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O -fdump-tree-optimized" } */ |
| 3 | |
| 4 | typedef int int32_t __attribute__((mode (__SI__))); |
| 5 | typedef unsigned uint32_t __attribute__((mode (__SI__))); |
| 6 | |
| 7 | int32_t foo (short a[], int32_t x) |
| 8 | { |
| 9 | uint32_t i; |
| 10 | for (i = 0; i < 1000; i++) |
| 11 | { |
| 12 | x = a[i]; |
| 13 | a[i] = (x <= 0 ? 0 : x); |
| 14 | } |
| 15 | return x; |
| 16 | } |
| 17 | |
| 18 | /* { dg-final { scan-tree-dump-not " = MAX_EXPR <x_\[0-9\]*" "optimized" } } */ |