1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fsplit-paths -fdump-tree-dom3-details" } */
4 /* There should be two references to bufferstep that turn into
6 /* { dg-final { scan-tree-dump-times "Replaced .bufferstep_\[0-9\]+. with constant .0." 1 "dom3"} } */
7 /* { dg-final { scan-tree-dump-times "Replaced .bufferstep_\[0-9\]+. with constant .1." 1 "dom3"} } */
9 /* And some assignments ought to fold down to constants. */
10 /* { dg-final { scan-tree-dump-times "Folded to: (?:bufferstep)?_\[0-9\]+ = 1;" 1 "dom3"} } */
11 /* { dg-final { scan-tree-dump-times "Folded to: (?:bufferstep)?_\[0-9\]+ = 0;" 1 "dom3"} } */
13 /* The XOR operations should have been optimized to constants. */
14 /* { dg-final { scan-tree-dump-not "bit_xor" "dom3"} } */
17 extern int *stepsizeTable
;
20 adpcm_coder (signed char *outdata
, int len
)
26 outp
= (signed char *) outdata
;
30 for (; len
> 0; len
--)
35 step
= stepsizeTable
[index
];
37 outputbuffer
= (delta
<< 4) & 0xf0;
39 *outp
++ = (delta
& 0x0f) | outputbuffer
;
40 bufferstep
= !bufferstep
;