source: tests/ctrl-flow/loop-inc.cfa @ 503c350

Last change on this file since 503c350 was 1fb09ef, checked in by Andrew Beach <ajbeach@…>, 2 years ago

Grouped some control flow tests together.

  • Property mode set to 100644
File size: 287 bytes
Line 
1forall(T &)
2struct A {
3    T * next;
4};
5
6struct B {
7    A(B) link;
8};
9
10int main(void) {
11        B end = { { 0p } };
12        B two = { { &end } };
13        B one = { { &two } };
14        B * head = &one;
15
16        for (B ** it = &head ; (*it)->link.next ; it = &(*it)->link.next) {
17                printf("loop\n");
18        }
19        printf("done\n");
20}
Note: See TracBrowser for help on using the repository browser.