Do not mark the transformed as visited. It makes no sense at all.
[libfirm] / ir / be / test / fehler158.c
1 /*$ -fconfirm -fcond-eval $*/
2
3 int test(int lnWrd, int *ptExp) {
4         int idx = 0;
5
6         while ( lnWrd > 0 ) {
7                 if ( *ptExp ) {
8                         *ptExp = 0;
9                         lnWrd--;
10                 }
11                 idx++;
12                 ptExp++;
13         }
14         return idx;
15 }
16
17 int arr[] = { 1, 0, 0, 0, 2, 3, 4};
18
19 int main(int argc, char *argv[]) {
20         int x = test(3, arr);
21         printf("%d\n", x);
22         return 0;
23 }